Home  >  Article  >  Web Front-end  >  How to set a tag to be non-clickable in css

How to set a tag to be non-clickable in css

王林
王林Original
2020-11-23 14:14:025794browse

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.

How to set a tag to be non-clickable in css

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!

Statement:
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

Related articles

See more