Home > Web Front-end > JS Tutorial > Two ways to set checkbox to readOnly_javascript skills

Two ways to set checkbox to readOnly_javascript skills

WBOY
Release: 2016-05-16 17:20:11
Original
1785 people have browsed it
Method 1:

The checkbox does not have a readOnly attribute. If you use the disabled="disabled" attribute, the checkbox will turn gray. Users are disgusted with this style. You can keep it only like this Read:
Set its onclick="return false"

In js it is checkbox.onclick=function(){return false;};

Method 2:
Copy code The code is as follows:



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