How to set a tag in css to be non-clickable: set the code [$(".demo").attr("disabled",true).css("pointer-events","none")], pointer The events attribute specifies whether the element becomes the target of mouse events.
The operating environment of this tutorial: Windows 10 system, CSS3 version. This method is suitable for all brands of computers.
css method to set a tag to be non-clickable:
Prohibit a tag to be clicked
(Learning video sharing: css video tutorial)
$(".demo").attr("disabled",true).css("pointer-events","none");
pointer-events attribute:
pointer-events is an attribute of css3, which specifies under what circumstances an element can become the target of mouse events (including mouse style).
pointer-events:auto | none | visiblePainted | visibleFill | visibleStroke | visible | painted | fill | stroke | all | inherit
You can click:
$(".demo").attr("disabled",false).css("pointer-events","auto");
Browser compatibility
Firefox 3.6, chrome 2.0 and safari 4.0 all support this CSS3 attribute, but IE6/7/8/9 does not Support
Related recommendations:CSS tutorial
The above is the detailed content of How to set a tag to be non-clickable in css. For more information, please follow other related articles on the PHP Chinese website!