How to make a tag unavailable in jquery

coldplay.xixi
Release: 2021-01-08 18:05:44
Original
2494 people have browsed it

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].

How to make a tag unavailable in jquery

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');
Copy after login

Remove the onclick event in the a tag

$('.disableCss').removeAttr('onclick');
Copy after login

If there is a data-toggle to switch the tab page attribute, you need to add a

$(".disableCss").removeAttr('data-toggle');
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!