搜索文档
首页
HTML/CSS
JavaScript
服务端开发
Java教程
移动端
数据库
当前位置:
首页
JavaScript
jQuery 教程
jQuery 参考手册
源代码
清空
点击运行
<!DOCTYPE html> <html> <title>jQuery :checkbox选择器示例 - 基础教程(div.cn)</title> <head> <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script> <script> $(document).ready(function(){ $(":checkbox").wrap("<span style='background:black'>"); }); </script> </head> <body> <form action="action_page.php"> <input type="checkbox" name="color1" value="red">我喜欢红色<br> <input type="checkbox" name="color2" value="green">我喜欢绿色<br> <input type="checkbox" name="color3" value="blue">我喜欢蓝色<br> <br> <input type="submit" value="Submit"> </form> </body> </html>
运行结果