Home >Web Front-end >JS Tutorial >How to make a tag unavailable in jquery
Jquery method to make the a tag unavailable: 1. Remove the href attribute in the a tag, the code is [$('.disableCss').removeAttr('href')]; 2. Remove the href attribute in the a tag Onclick event, the code is [$('.disableCss').remo].
The operating environment of this tutorial: windows7 system, jquery3.2.1 version, Dell G3 computer.
Jquery method to make the a tag unavailable:
Remove the href attribute in the a tag
$('.disableCss').removeAttr('href');
Remove the onclick event in the a tag
$('.disableCss').removeAttr('onclick');
If there is a data-toggle to switch the tab page attribute, you need to add a
$(".disableCss").removeAttr('data-toggle');
At this time, the a label is no longer clickable, but when the mouse is moved up, the font will still change color
Related learning recommendations: javascript video tutorial
The above is the detailed content of How to make a tag unavailable in jquery. For more information, please follow other related articles on the PHP Chinese website!