jquery checked选择器 语法
作用::checked 选择器选取所有选中的复选框或单选按钮。直线电机参数
语法:$(":checked")
jquery checked选择器 示例
<html> <head> <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $(".btn1").click(function(){ $(":checked").hide(); }); }); </script> </head> <body> <form action=""> <input type="radio" name="sex" value="male" checked="checked"/> Male <br /> <input type="radio" name="sex" value="female" /> Female <br /> I have a bike: <input type="checkbox" name="vehicle" value="Bike" /> <br /> I have a car: <input type="checkbox" name="vehicle" value="Car" checked="checked" /> <br /> I have an airplane: <input type="checkbox" name="vehicle" value="Airplane" /> </form> <button class="btn1">Hide Checked Options</button> </body> </html>
来源:https://www.cnblogs.com/furuihua/p/11978287.html