开发者

Jquery loop all radio boxes and return value

开发者 https://www.devze.com 2023-01-19 23:42 出处:网络
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?

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

精彩评论

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