asp.net js 如何取到RadioButton 的 id 的问题?

代码如下
js :
function shows(zhiId, shuxing, waiType) {
alert("111");
if (document.getElementById("RadioButton1").checked == true) {
alert("1");
waiType = 1;
}
else if (document.getElementById("RadioButton2").checked) {
alert("2");
waiType = 2;
}
window.location.href = 'zhiLookDetail.aspx?zhiId=' + zhiId + '&shuxing=' + shuxing + '&waiType=' + waiType;
}

页面代码: RadioButton 是在 两个 Panel 内

图片说明

错误为:

图片说明

这里取不到!

图片说明
求大神 指点迷津~

你那样取肯定取不到的,因为RadioButton1是服务端控件的id,你要取只能查看网页代码,找到页面生成的radio button的id,
类似这样的,id="XXX_RadioButton1"

是不是不用 == true?

试着在两个Button 之一上加一个属性 checked

谢了!各位 我已经解决了 ! 加上这个就行了 !~

document.getElementById('<%=RadioButton1.ClientID %>').checked