如何用Jscipt控制在点击单选input后,其后的文字能跟着变化颜色? 除了圆点变红,只是文字上有框,我想圆点和其后的文字一起变化颜色!!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你把前面部分改成用asp生成就行了<form> <input name="answtxt" type="radio" value="1" id = "radio1" onclick="return check()"> <label for="radio1" id="anslabel">12323</label> <input name="answtxt" type="radio" value="1" id = "radio2" onclick="return check()"> <label for="radio1" id="anslabel">12323</label> </form>用jscript<script language="JScript" >function check(){ var i; for(i=0;i< document.forms[0].answtxt.length;i++) { if(document.forms[0].answtxt[i].checked) {document.all.answtxt[i].style.backgroundColor="red" document.all.anslabel[i].style.backgroundColor='red' } else {document.all.answtxt[i].style.backgroundColor="" document.all.anslabel[i].style.backgroundColor='' } } return true;}</script> Ext中TreePanel的combo数据加载问题 禁用了Firebug,Ajax也不成功了。有人遇到过这样的问题么? 用JS做游戏从哪里学起快!? 网页下拉列表框的问题 请BlueDestiny帮下忙,有关Js兼容性的问题,谢谢 在当前页显示提交的结果 如何取得iframe里文档页面的高度? 请大家来看看,应该怎样写???????????? 请问如何用js判断某一客户端文件是否存在? js关于计算一年有几周,要求每周都要知道是几号到几号 http://218.12.112.9/index1.asp(大家帮看看) 还是自动累加问题,大家帮帮忙?
<form>
<input name="answtxt" type="radio" value="1" id = "radio1" onclick="return check()"> <label for="radio1" id="anslabel">12323</label>
<input name="answtxt" type="radio" value="1" id = "radio2" onclick="return check()"> <label for="radio1" id="anslabel">12323</label>
</form>
用jscript
<script language="JScript" >
function check()
{
var i;
for(i=0;i< document.forms[0].answtxt.length;i++)
{
if(document.forms[0].answtxt[i].checked)
{document.all.answtxt[i].style.backgroundColor="red"
document.all.anslabel[i].style.backgroundColor='red'
}
else
{document.all.answtxt[i].style.backgroundColor=""
document.all.anslabel[i].style.backgroundColor=''
}
}
return true;
}
</script>