2013-12-14 70 views
0

我有一个窗体元素动态显示的窗体。我需要检查表单是否包含单选按钮。如何检查表单是否包含单选按钮?

+1

只是委派内的单选按钮存在校验码记录...防爆'$(文件)。在(“事件”,”选择器',function(){});' –

+7

检查它:'if($('form')。find(':radio')。length)' –

+0

感谢它工作正常。 – techierishi

回答

0
if ($('#myform').find(':radio').length) { 
    // do something if found 
    alert("Found "+$('#myform').find(':radio').length+" radio buttons."); 
} 
0

好,你可以做这样的:

if($(":radio", "#myform").length){ 
    // Bingo, I got it 
    // do something 
} 
相关问题