admin 管理员组文章数量: 1086019
Is it possible upon page entry to modify this code to uncheck check box id LOTL even if the page is cached?
<script type="text/javascript">
function formReset()
{
document.getElementById("LOTL").reset();
}
</script>
Is it possible upon page entry to modify this code to uncheck check box id LOTL even if the page is cached?
<script type="text/javascript">
function formReset()
{
document.getElementById("LOTL").reset();
}
</script>
Share
Improve this question
edited Oct 4, 2012 at 17:22
Ram
145k16 gold badges172 silver badges200 bronze badges
asked Oct 4, 2012 at 17:15
Rocco The TacoRocco The Taco
3,79714 gold badges50 silver badges80 bronze badges
0
5 Answers
Reset to default 14You can use prop
method:
$(document).ready(function(){
$('#LOTL').prop('checked', false);
// document.getElementById("LOTL").checked = false
})
This should do the trick:
$(document).ready(function()
{
$('#LOTL').attr('checked', false);
});
Is the LOTL element the checkbox or the form?
If it is the checkbox you might try this:
$( '#LOTL' ).removeAttr( 'checked' );
function formReset(){
document.getElementById("LOTL").checked = false;
}
Try this to uncheck
$(function() {
$('#LOTL').prop('checked', false);
});
本文标签: javascriptUncheck checkbox with jqueryStack Overflow
版权声明:本文标题:javascript - Uncheck checkbox with jquery? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://roclinux.cn/p/1744099834a2533447.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论