开发者

Jquery loop all radio boxes and return value

how would i loop through all the radio boxes on the page and get the value? have the following command got anything to do 开发者_如何学JAVAwith it?

$('input[type=radio]')


Update:

To loop through checked ones, you can use the :checked filter selector this way:

$(':radio:checked').each(function(){
   alert($(this).val());
});

You can use the each method like this with :radio (shortcut) filter selector:

$(':radio').each(function(){
   alert($(this).val());
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜