<input type="radio" class="input2" name="business_role" id="business_role" value="seller" onclick="tr_display('sell');"> 销售 <input type="radio" class="input2" name="business_role" value="buyer" onclick="tr_display('buy');"> 采购<SCRIPT LANGUAGE="JavaScript">
<!--
function tr_display(strValue){
if(document.all["business_role"][0].checked==true){
alert("first radio is checked");
}else{
alert("second radio is checked");
}
alert(strValue);
}
//business_role.checked = true; 什么意思?
//-->
</SCRIPT>
<!--
function tr_display(strValue){
if(document.all["business_role"][0].checked==true){
alert("first radio is checked");
}else{
alert("second radio is checked");
}
alert(strValue);
}
//business_role.checked = true; 什么意思?
//-->
</SCRIPT>
business_role
这些取得的是一组控件,而不是一个控件,你怎么给他们设置 checked 属性??
销售
<input type="radio" name="business_role" id="a2" value="buyer" onclick="tr_display('buy');">
采购
<script language="JavaScript">
a1.checked=true;
</script>