How to protect user to clear checkbox using javascript ?
I want to protect clear checkbox from user using javascript
(not use disabled tag) How can i do that ?
<input type="checkbox" id="c1" checked> Do not uncheck
How to protect user to clear checkbox using javascript ?
I want to protect clear checkbox from user using javascript
(not use disabled tag) How can i do that ?
<input type="checkbox" id="c1" checked> Do not uncheck
Not sure why you'd want a checkbox that can't be unchecked but you can simply do this:
$(".dontUncheck").click(function(e){
e.preventDefault();
$(this).prop("checked", "checked");
});
<input type='checkbox' checked class="dontUncheck" />
Here's the fiddle: http://jsfiddle.net/0x9vp6ca/