首页 > 技术文章 > <input type="radio" >控件取值、change事件

webttt 2020-11-04 14:41 原文

<input type="radio" class="ridio-box" checked=""  value="0" name="monitorType">  A
<input type="radio" class="ridio-box" value="1" name="monitorType"> B

  

$('input[type=radio][name=monitorType]').change(function() {
        var monitorType=$("input[type='radio'][name='monitorType']:checked").val();
        if(monitorType==0){
           //aaaa
        }
        else{
           //bbbb
        }
    });

  




推荐阅读