Play Flash Games


© 2007 Red Computer

HTML Howto, CSS Howto, JavaScript Howto, PHP Howto, Windows Howto
Google

Enable Click On Checkbox Label


On Windows, when you want to check the checkbox you can click at it's label but you can not do that on Internet Explorer. This is the way to enable click on checkbox' label :

<script type="text/javascript">
function labelClick(cbObject) {
    cbObject.checked = !cbObject.checked
}
</script>

<form name="testForm">
    <input type="checkbox" name="cb1"/>
    <span style="cursor:hand" onclick="labelClick(document.testForm.cb1)">Clic here to enable or disable the checkbox.</span>
</form>

Click the lebel below to see the result :
Clic here to enable or disable the checkbox.





Visitor's Comment

Post a Comment
Comment
Name :
E-mail :

HOME | HTML | CSS | JavaScript | PHP | XML | SQL | Virus Fix | Windows | Downloads | Links