![]() |
|
|
+ Search |
![]()
|
Jun 9th, 2005 00:11
Russ Locke, Labanya Roy,
// First you need to know that when following the DOM
// checkbox is a type of INPUT tag (tagName)
var ckCnt = 0; // checkbox counter
// tagName is referenced as a CAPITALIZED value
var obj = document.getElementsByTagName('INPUT');
for (i=0; i<obj.length; i++) {
// type is referenced as a lowercase value
if (obj[i].type == 'checkbox') {
ckCnt++;
}
}
alert(ckCnt);