I'm using the Prototype framework the following code to get the length of the checked check box length which is working in Mozilla , but not working in IE 7 ?
questionIdArray[i] = 5;
i开发者_运维问答d="choiceCheckBox-"+questionIdArray[i];
length = $$('input[name='+id+']:checked').length;
Not seeing all of your code it's hard to say if this is the problem, but based on what you've posted my first guess is that you aren't initializing length
as a local variable, so your code is actually applying the value to window.length
, which appears to be a protected variable in IE7.
Add var
in front of your assignment.
精彩评论