2011-01-27 61 views

回答

0

看看這個.... 假設HTML檢索所選類型的值這是... ...

<label><input type="radio" name="color" value="red" checked="checked" />Red</label><br /> 
<label><input type="radio" name="color" value="red" checked="checked" />Blue</label><br /> 

然後jQuery將是

var the_value; 
the_value = jQuery('input:radio:checked').val(); 
alert(the_value); 

DEMO

2
var var_name = $("input[name='your_radio_name']:checked").val();