<INPUT onMouseOver="this.style.backgroundColor='red';this.style.color='#ffffff'" onMouseOut="this.style.backgroundColor='';this.style.color='#000000'" type="text" value="ff">

解决方案 »

  1.   

    问题是这样的:
    在一个表格中,每行都有一个checkbox,当checkbox被选中时,这一行的所有文本框的背景色都变为红色,怎么做啊!
    谢谢
      

  2.   

    <input type="text" onmouseover="this.style.color='pink';this.style.backgroundColor='deepskublue';">
      

  3.   

    <script>
    var tt = 1;
    </script>
    <BODY>
    <table>
    <tr>
    <td>
    <input type="checkbox" id="cb1" onclick="if(tt) {txt1.style.backgroundColor='pink';tt=0;} else {txt1.style.backgroundColor='#ffffff';tt=1;}"><input type="text" id="txt1">
    </td>
    </tr>
    </table>
    </BODY>
    不好意思,写多一个,嘿嘿
      

  4.   

    To: aniude(阿牛的乜乜)
    如果一行中有多个文本框时怎么办啊?
    你那个只有一个呀
      

  5.   

    <html><head>
    <style>
    .noChildElementsTr input
    {
    background-color:#cccccc;
    color:red;
    }
    </style>
    </head><body>
    显示
    <table width=100% >
    <tr >
    <td>
    <input type=checkbox onclick="this.parentElement.parentElement.className=(this.checked?'noChildElementsTr':'')" >
    </td>
    <td>
    aaa <input value=aaa>
    </td>
    <td>
    aaa <input value=bbb>
    </td>
    </tr>
    <tr >
    <td>
    <input type=checkbox onclick="this.parentElement.parentElement.className=(this.checked?'noChildElementsTr':'')" >
    </td>
    <td>
    aaa <input value=aaa>
    </td>
    <td>
    aaa <input value=bbb>
    </td>
    </tr>
    </table></body></html>