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

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

王林
Release: 2020-11-30 11:10:32
Original
5843 people have browsed it

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

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
Copy after login

You can click:

$(".demo").attr("disabled",false).css("pointer-events","auto");
Copy after login

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!

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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template