除了圆点变红,只是文字上有框,我想圆点和其后的文字一起变化颜色!!!

解决方案 »

  1.   

    你把前面部分改成用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>