您的位置:首页 > Web前端 > JavaScript

js怎么判断是否选择且取出选择的值

2016-12-17 11:43 127 查看
function showsure(){

    var select=$(".radio input[name=aduit]");

    for(i=0;i<select.length;i++){

        if(select[i].checked){

            alert(select[i].value);

        }

    }

}

<div class="radio">
                   <label>
                     <input type="radio" name="aduit"  value="1" checked>
             
      通过
                   </label>
                
                   <label>
                     <input type="radio" name="aduit"  value="2">
                     
不通过
                   </label>
                 </div>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: