How to use plain CSS to disable the a tag in HTML without JavaScript

Source: Internet
Author: User
To this day, still do not find the use of pure CSS to disable the A-label approach, do you really have to rely on javascript? In fact, there are a lot of methods, the following is introduced by JS, Jquey and CSS to implement the Disable a tag actually this problem in the first learning HTML in the SELECT tag has come out, to this day, still do not find the use of pure CSS to disable a label method-colleagues, classmates, Teacher I have asked, they are all the same with the use of JavaScript, really have to use JavaScript?

1, pure CSS to implement the HTML in the A-label disable:

The code is as follows:



Although the above uses pure CSS to implement the A-label disable, but because opera, IE browser does not support the pointer-events style, so the above code in these two types of browsers do not play the role of disabling a tag.

2. Use jquery and CSS to implement the disable of a tag in HTML:

The code is as follows:



This way can be compatible with all browsers, but mixed with JavaScript, this is probably fatal flaw!!!

3. Use jquery to implement the disable of a tag in HTML:

The code is as follows:

The


above uses pure jquery to implement the ability to disable the a tag in HTML.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.