在浏览器中查看页面源代码。看看input标签的id是否正常
[quote=引用 16 楼 herlioner 的回复:] [quote=引用 15 楼 xiaoyuyu1111 的回复:] [quote=引用 9 楼 herlioner 的回复:] [quote=引用 8 楼 xiaoyuyu1111 的回复:] 你这个难道不是双引号匹配的问题吗?
[quote=引用 9 楼 herlioner 的回复:] [quote=引用 8 楼 xiaoyuyu1111 的回复:] 你这个难道不是双引号匹配的问题吗?
[quote=引用 15 楼 xiaoyuyu1111 的回复:] [quote=引用 9 楼 herlioner 的回复:] [quote=引用 8 楼 xiaoyuyu1111 的回复:] 你这个难道不是双引号匹配的问题吗?
[quote=引用 14 楼 like78569 的回复:] 好像不用那么写吧,在checkbox上 objxxx(this); js: function objxxx(obj){ if(obj.checked==true){ alert("aaal"); } }
好像不用那么写吧,在checkbox上 objxxx(this); js: function objxxx(obj){ if(obj.checked==true){ alert("aaal"); } }
[quote=引用 8 楼 xiaoyuyu1111 的回复:] 你这个难道不是双引号匹配的问题吗?
写错了吧,你的if判断好像执行不了。 js应该是这样写吧 if(document.getElementById('abc').checked) { alert(id) }
document.getElementById(这里要写id的属性值,不能直接写个id吧?) 你那样写应该获取不到输入框对象的
你这个难道不是双引号匹配的问题吗?
再有,this是关键字,不能作为函数的形式参数或变量名。
你的id变量没有定义啊,要类似这样 <input type="checkbox" ............... onclick="objselected(this.id)" /> function objselected(id) { }
87,716
社区成员
224,624
社区内容
加载中