SoFunction
Updated on 2025-03-03

Complete analysis and summary of removing the dotted link lines

Traditional method: Adding attributes to the tag has many codes, making it difficult to modify

<a href="" onfocus="()">link1</a>

<a href="" onfocus="()">link1</a>

<a href="" hidefocus="true">link1</a>

<a href="" hidefocus="hidefocus">link1</a>

<a href="" hidefocus>link1</a> Non-standard

Intermediate method, global control

CSS implementation increases IE burden, not recommended

a{blr:expression(=());}

a{blr:expression(=());}

HTC implements IE support and has delays, not recommended

Save the following code as a file with .htc as an extension

<public:attach event="onfocus" onevent="hscfsy()"/>
<script language="javascript">
function hscfsy(){
();
}
< /script>

Style Call

a {behavior:url(path address where the htc file is located)}

Advanced approach, global control

Traversal implementation

=function()
{
 for(var ii=0; ii<; ii++)
 [ii].onfocus=function(){()}
}

Encapsulate it into a function

function fHideFocus(tName){
aTag=(tName);
for(i=0;i<;i++)aTag[i].hideFocus=true;
//for(i=0;i<;i++)aTag[i].onfocus=function(){();};
}

Currently, add a hidefocus property, and the commented sentence is to add onfucus=();
Then call fHideFocus("A"); to remove the dotted box of a
By passing different parameters, more dotted frames can be removed. For example, "BUTTON" can be removed.
But remember to use capital letters for parameters

Application skills and questions

A. How to eliminate the dotted link line in map area?

This is a conceptual mistake. In fact, it should be controlled on the image of the map, rather than within the area.

B. About onFocus

<a href=“/alonesword/“ onFocus="()"> 
<Img Src="" Border=0> 
</a>

Among them, onFocus is something that sets the mouse focus event. This can be used or not. However, in order to make more browsers recognize it, it is recommended to use it; Border=0 This is the key to removing the dotted frame (I saw on the Internet that some people use onFocus="()" to eliminate the dotted frame, but when testing locally, using this sentence alone cannot be eliminated)