Home  >  Article  >  Web Front-end  >  How to disable a label button in css

How to disable a label button in css

王林
王林forward
2020-05-06 09:07:535637browse

How to disable a label button in css

First of all, we know that the a tag does not have a disabled attribute, so how do we disable the a tag button?

Solution:

Method 1: Remove the click event click or touchend

We can directly use jquery: unbind() or JS: removeEventListener ()Remove click event.

(Recommended video tutorial: css video tutorial)

Method 2: Set the attribute pointer-events:none for the a tag

pointer-events:none is an attribute in CSS3, which means disabling mouse events, which actually removes the click event!

Method 3: Remove the href attribute of the a tag

We can use jquery:removerAttr() or JS:removeAttribute() to remove the href attribute of the a tag.

Recommended tutorial: css quick start

The above is the detailed content of How to disable a label button in css. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:cnblogs.com. If there is any infringement, please contact admin@php.cn delete