检查单选按钮是否检查不工作jquery [英] check if radio button checked not working jquery
本文介绍了检查单选按钮是否检查不工作jquery的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<script type="text/javascript">
$(document).ready(function() {
if($("#image").is(":checked"))
{
alert('yeas');
}
});
</script>
<div class="form-group">
<input type="radio" name="type" value="image" id="image" />
<label for="image">image</label>
<input type="radio" name="type" value="code" id="code"/>
<label for="code">code</label><br />
</div>
无法解决我的代码中出错的问题
not working what's wrong in my code
推荐答案
(document).ready(function(){
if(
(document).ready(function() { if(
(#image)。is(:checked ))
{
alert('yeas');
}
});
< / script >
("#image").is(":checked")) { alert('yeas'); } }); </script>
<div class="form-group">
<input type="radio" name="type" value="image" id="image" />
<label for="image">image</label>
<input type="radio" name="type" value="code" id="code"/>
<label for="code">code</label><br />
</div>
我的代码无法正常工作
not working what's wrong in my code
试试这个。 ..
Try this...
<script type="text/javascript">
这篇关于检查单选按钮是否检查不工作jquery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文