jquery获得单选框中选中的值

<div class="radioGroup">
    <input type="radio" name="ticketType" value="1" checked >
    <input type="radio" name="ticketType" value="2" >
    <input type="radio" name="ticketType" value="3" >
</div>

    获得选中的radio的值:

    

var type = $('.radioGroup input[name="ticketType"]:checked ').val();

猜你喜欢

转载自cocoding.iteye.com/blog/2304669