IE,jquery复选框不会改变
16lz
2021-01-22
I have this html syntax:
我有这个HTML语法:
<input type="checkbox" id="openInNewWindowCheckBox" value ="some_value" />
and a jquery script:
和一个jquery脚本:
$("#openInNewWindowCheckBox").change(function(){
if($(this).is(':checked'))
{
}
else
{
}
return false;
});
and in IE i just can't change or unchange the checkbox, html for it looks like this:
在IE中我只是无法更改或取消更改复选框,html因为它看起来像这样:
<input id="openInNewWindowCheckBox" type="checkbox" _just_changed="true" jQuery18203967820199374023="133" value="some_value"/>
2 个解决方案
#1
2
Returning false prevents the default action. You try returning true for that.
返回false会阻止默认操作。你尝试为此返回true。
$("#openInNewWindowCheckBox").change(function(){
if($(this).is(':checked'))
{
console.log('a');
}
else
{
console.log('b');
}
return true;
});
更多相关文章
- 如何从Python脚本向jQuery发送JSON对象?
- Ajax调用php脚本返回404错误
- 使用jquery的$ .ajax来获取node.js脚本的输出,而不是它的代码
- Chrome显示错误为:由于内容安全策略,拒绝执行内联脚本
- jquery之data()、stop()、delay()的语法和使用
- 提交表单时需要运行php脚本
- 用无序列表键入文本脚本
- Python脚本利用openoffice将office文档转为html或者pdf。
- 韩顺平_轻松搞定网页设计(html+css+javascript)_第19讲_js运行原