Author: Star Ocean Source: 5D Multimedia
Everyone wants to know, οnfοcus = "this.blur ()" This code can eliminate the dotted line box when the link is linked, but have you ever thought that if you have a few or even hundreds of links on your web, you think To get rid of the hateful line boxes, do you still go to Ctrl C, Ctrl V, God! This is definitely a bad dream for a normal person. Maybe you will say that you can solve it with the "Find / Replace" feature in the DW or other text editor. It is undeniable that this is a good way, but as an excellent web developer, the same function as possible with as few code is the goal we should pursue. Let's use HTC to solve this problem. As for HTC, the full name is HTML Components, which is provided by Microsoft to set a new instructions provided by IE5.0, which can encapsulate a particular function of code in one component, thus implementing the reuse of the code. . As a component, the HTC includes various knowledge of properties, methods, events, etc., here is not only introduced, and the specific content can refer to Microsoft's MSDN home page.
Go back to the beginning, onfocus = this.blur () is clear here, onfocus is an event, this.blur () is an object triggered by the event, since this is clear, the code knows how to write.
Function example () {
THIS.BLUR ();
}
script>
Save the above code as .htc as the extension file, and then write a normal HTML page
a {behavior: URL (the path address of the HTC file)}
style>
Try the link, no dashed box.
body>
html>
OK, save, preview, how? The effect is out, then look at the code, it is indeed a lot of streamline, and the more you reflect it, the more it is more obvious. Finally, I have to say that this is just the HTC app, more features need you to know, I believe that you must learn more about JS and CSS base.