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.