向复选框插入背景图像
- <html>
- <head>
- <script type="text/javascript">
- function bgChange(bg)
- {
- document.getElementById('x').style.background="url(" + bg + ")"
- }
- </script>
- </head>
-
- <body>
-
- <p>本例演示如何改变单选按钮的背景颜色。</p>
- <p>请把鼠标移动到下面的三个表格单元上,背景颜色将会改变:</p>
-
- <table width="300" height="100">
- <tr>
- <td onmouseover="bgChange('/i/eg_bg_03.gif')"
- background="/i/eg_bg_03.gif">
- </td>
- <td onmouseover="bgChange('/i/eg_bg_04.gif')"
- background="/i/eg_bg_04.gif">
- </td>
- </tr>
- </table>
-
- <form>
- 请把鼠标移动到图像上:
- <input id="x" type="checkbox" checked value="ON">
- </form>
-
- </body>
- </html>