持续更新一些jquery相关内容

jquery相关的一些东西

说明

持续更新一些jquery相关内容,以下源码地址:Github

1.获取选中的radio的值

<div>
    <input type="radio" value="0" name="state" id="radio_1">
    <label for="radio_1">正常</label>
    <input type="radio" value="1" name="state" checked id="radio_2">
    <label for="radio_1">待审核</label>
    <input type="radio" value="2" name="state" id="radio_3">
    <label for="radio_1">已作废</label>
    <button id="btn_get_radio">获取选中的radio的值</button>
</div>
$('#btn_get_radio').click(function () {
    var rsult = $('input[name="state"]:checked').val();
    alert(result);
});

猜你喜欢

转载自blog.csdn.net/zhaobw831/article/details/78226857