????:<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0">&
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> <script src="static/js/jquery-3.3.1.min.js"></script> </head> <body> <script> /* 表單選擇器 $(":enabled")所有激活(可以使用的)input元素 $("input:enabled").css("background", "red"); $(":disabled")所有禁用(不可以使用的)input元素 $("input:disabled").css("background", "red"); $(":selected")所有被選取select元素 $("input:selected").css("color", "red"); $(":checked")所有被選中的input元素 $(":checked").parent().css("color", "pink"); */ $(document).ready(function () { $(":checked").parent().css("color", "pink"); }); </script> <form action=""> <input type="text" name=""> <input type="text" name=""> <input type="text" name="" disabled="disabled"> <input type="text" name=""> <select name="" id=""> <option value="">雙魚座</option> <option value="" selected="selected">射手座</option> <option value="">獅子座</option> </select> <label for=""><input type="checkbox" name="" id="" checked>1</label> <label for=""><input type="checkbox" name="" id="" >2</label> <label for=""><input type="checkbox" name="" id="" checked>3</label> <label for=""><input type="checkbox" name="" id="" >4</label> </form> </body> </html>
?? ???:查無此人?? ??:2019-01-14 16:16:24
???? ??:代碼要縮進(jìn),要成好習(xí)慣。做的還不錯,checked默認(rèn)選中不要出現(xiàn)兩個。加油。