jquery获取radio的value值

单选框

界面代码

<div style="display: flex;justify-content: space-around;align-items: center">
           <input class="my-input" type="radio" name="store_type" checked="value"  value="0"/>门店
           <input class="my-input" type="radio" name="store_type"  value="1" />仓库
</div>

jQuery代码

jQuery代码

 var store_type = $("input[type='radio']:checked").val();
        console.log(store_type);

输出内容

猜你喜欢

转载自blog.csdn.net/Depressiom/article/details/123128055