Click on a label other former label a recovery

Suppose a tag 3, when the first click on a label, the label is a color that is not clicked, the color of the holding clicks, but a click of other tab, which color restoration.

css:

A { text-Decoration : none ; font-size : 12px ; Color : Blue } 
A: hover { Color : Red } 
A: the FOCUS {   / * Set the mouse to move a focal length * / 
Color : # b34927 ; 
}

js:

// A click on a color label, do not click another color. 
. $ ( "Document") READY ( function () {
     / * $ ( "A") the Click (function () {. 
        $ (the this) .css ( "Color", "White"); 
         $ (the this) .siblings () .css ( "Color", ""); 
    }); * / 
    
    //
      var of aList document.getElementsByTagName = ( "A" );
      for ( var I = 0, len = aList.length; I <len; I ++ ) { 
     of aList [I] .removeAttribute ( "style" ); 
     } 
     the this .style.color = "Red"; // color to be set 


});

 

Guess you like

Origin www.cnblogs.com/ciscolee/p/11273173.html