checked
英[tʃekt] 美[tʃɛkt]
adj.方格圖案的;受阻的;封閉的
v.檢查,核對(check的過去式和過去分詞)
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>
#點擊 "執行實例" 按鈕查看線上實例