javascript checkbox select all

Here is the javascript code for checking all the checkboxes inside an html document.

<script>
function checkAll()
{

var inputs = document.getElementsByTagName(’input’);
var checkboxes = [];
for (var i = 0; i < inputs.length; i++) {

  if (inputs[i].type == ‘checkbox’) {
inputs[i].checked =true;

}
}
}

</script>


Add to Del.cio.us RSS Feed Add to Technorati Favorites Stumble It!

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!