Created
September 8, 2014 00:07
-
-
Save uicoded/428ee9f22d2a9ae36fd0 to your computer and use it in GitHub Desktop.
HTML - input type checkbox disabled HTML - input type checkbox disabled // source http://jsbin.com/boqeko/2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="description" content="HTML - input type checkbox disabled"> | |
<title>HTML - input type checkbox disabled</title> | |
<style id="jsbin-css"> | |
fieldset{ | |
margin: 2em 0; | |
} | |
button{ | |
cursor: pointer; | |
} | |
</style> | |
</head> | |
<body> | |
<h1>HTML - input type checkbox disabled</h1> | |
<form action=""> | |
<label for="standalone">Standalone disabled checkbox</label><input id="standalone" type="checkbox" disabled> | |
<p><button id="flip">enable</button></p> | |
<fieldset> | |
<legend>Checkbox group</legend> | |
</fieldset> | |
</form> | |
<script id="jsbin-javascript"> | |
var ch1 = document.getElementById('standalone'), | |
flipButton = document.getElementById('flip'); | |
flipButton.onclick = function (){ | |
if(ch1.disabled){ | |
ch1.disabled = false; | |
this.value = 'disable'; | |
}else{ | |
ch1.disabled = true; | |
this.value = 'enable'; | |
} | |
return false; | |
} | |
</script> | |
<script id="jsbin-source-css" type="text/css">fieldset{ | |
margin: 2em 0; | |
} | |
button{ | |
cursor: pointer; | |
}</script> | |
<script id="jsbin-source-javascript" type="text/javascript">var ch1 = document.getElementById('standalone'), | |
flipButton = document.getElementById('flip'); | |
flipButton.onclick = function (){ | |
if(ch1.disabled){ | |
ch1.disabled = false; | |
this.value = 'disable'; | |
}else{ | |
ch1.disabled = true; | |
this.value = 'enable'; | |
} | |
return false; | |
} | |
</script></body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fieldset{ | |
margin: 2em 0; | |
} | |
button{ | |
cursor: pointer; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ch1 = document.getElementById('standalone'), | |
flipButton = document.getElementById('flip'); | |
flipButton.onclick = function (){ | |
if(ch1.disabled){ | |
ch1.disabled = false; | |
this.value = 'disable'; | |
}else{ | |
ch1.disabled = true; | |
this.value = 'enable'; | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment