(随手记)jquery获取radio的值

html代码:

<input type="radio" id="callSuccess" name="isSuccessCalled" value="1" />呼叫成功
<input type="radio" id="callFail" name="isSuccessCalled" value="2" />呼叫失败

 

jquery代码:

var radioVal = $('input:radio[name="isSuccessCalled"]:checked').val();

if(radioVal == null){

  alert("请选择结果!");

}

posted @ 2013-01-11 16:13  积累从点滴开始  阅读(156)  评论(0编辑  收藏  举报