- 3/5
- 1
- 2
- 3
- 4
- 5
织梦DedeCMS视频教程买空间 租服务器 选网硕互联! 无忧站长工具,百度权重一键全查!
选中复选框时文字变色,加上一个背景,变通一下,还是很有用的。
<html> <head> <title>选中复选框文字变色</title> <style> .checkbox { background-Color:e-xpression(this.checked?'yellow':'buttonface'); } </style> </head> <script> function chaCloor(field){ var pig = field.checked; pig?field.nextSibling.style.backgroundColor="skyblue":field.nextSibling.style.backgroundColor="white"; } </script> <body> <table height=48 width=136> <tr> <td><input type="checkbox" onClick="chaCloor(this)"><span>网页特效</span></td> </tr> <tr> <td><input type="checkbox" onClick="chaCloor(this)"><span>源码下载</span></td> </tr> <tr> <td><input type="checkbox" onClick="chaCloor(this)"><span>编程软件</span></td> </tr> </table> </body> </html>