开发者

`$$` working in mozilla but not working in IE 7

开发者 https://www.devze.com 2023-02-26 02:33 出处:网络
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 ?

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消