改变复选框的背景颜色
- <html>
- <head>
- <script type="text/javascript">
- function changeColor(color)
- {
- document.getElementById('x').style.background=color
- }
- </script>
- </head>
-
- <body>
-
- <p>本例演示如何改变复选按钮的背景颜色。</p>
- <p>请把鼠标移动到下面的三个表格单元上,背景颜色将会改变:</p>
-
- <table width="100%"><tr>
- <td bgcolor="red" onmouseover="changeColor('red')"> </td>
- <td bgcolor="blue" onmouseover="changeColor('blue')"> </td>
- <td bgcolor="green" onmouseover="changeColor('green')"> </td>
- </tr></table>
-
- <form>
- 请把鼠标移动到颜色上面
- <input id="x" checked type="checkbox" value="ON">
- </form>
-
- </body>
- </html>