2012-05-24 6 views
0

я определил радиокнопки, как сильфонныеполучает значение радио кнопки с JQuery

<tr> 
    <th height="35" scope="row"> 
     <div align="left">Response for Instruction</div> 
    </th> 
    <th scope="row"><input name="a" type="radio" value="Excellent" /></th> 
    <th scope="row"><input name="a" type="radio" value="Good" /></th> 
    <th scope="row"><input name="a" type="radio" value="Poor" /></th> 
    <th scope="row"><input name="a" type="radio" value="Needs Improvement " /></th> 
</tr> 

$(document).ready(function() { 
    var a = $('#a').attr('value'); 
    alert(a); 
} 

но его показ не определено.

Благодаря

ответ

5
$("input:radio[name=a]:checked").val() 
+0

спасибо за размещение –

0

Вероятно, это поможет ...

$("input[@name=a]:checked").val(); 
1

Try This

$("input:radio[name=a]").click(function() { 
    var value = $(this).val(); 
    console.log(value); 
    }); 
Смежные вопросы