JqueryDisable A-label Method 1
$ (document). Ready (function () {$ ("a"). each (function () {varTextValue = $ ( This). html (); if(TextValue = ="XX Overview"|| TextValue = ="Service Navigation") { $( This). CSS ("cursor","default"); $( This). attr ('href','#');//Modify the HREF attribute value of <a> to # so the status bar does not show the link address$( This). Click (Function (Event) { Event. Preventdefault ();//if <a> defines the target= "_blank" need this sentence to prevent the opening of a new page }); } });});
JqueryDisable A-label Method 2
$ ('a.tooltip'). Live ('click', function (event) { alert (" Sorry, deactivated! "); Event . Preventdefault (); });
jquery Disable A-label Method 3
$ (function () {$ ('. Disablecss'). Removeattr ('href' ) ); // Remove the href attribute in the A tag $ ('. Disablecss'). Removeattr ('onclick '); // Remove the onclick event from the A tag });
The jquery control button is disabled and enabled
$ ('#button'). attr ('disabled',"true "); Add the Disabled property $ ('#button'). Removeattr (" Disabled"); Remove Disabled property
jquery Disable a tag, jquery disable button click