Tuesday, February 28, 2012

Unchecking all checkboxes through JavaScript



Suppose we have 10 check boxes ..& checkboxes ID are chk1,chk2,chk3...
<script>
function selectOnlyThis(id) {
    for (var i = 0;i <= 10; i++)
    {
        document.getElementById("Chk" + i).checked = false;
    }
    
}
</script>
Call this function on a button click.

No comments:

Post a Comment