abstrakt:<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>jquery表單選擇器</title> <script type="text/javascript" src=&qu
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>jquery表單選擇器</title> <script type="text/javascript" src="https://code.jquery.com/jquery-3.1.1.min.js"></script> </head> <body> <script type="text/javascript"> $(document).ready(function(){ // $(':enabled')所有激活的input元素(可以使用的input元素) // $(':disabled')所有禁用的input元素(不可以使用的input元素) // $(':selected')所有被選取的元素,針對于select元素 // $(':checked')所有被選中的input元素 // $('input:enabled').css('background','red') // $('input:disabled').css('background','blue') // $(':selected').css('color','blue') $(':checked').parent().css('color','red') }) </script> <form> 輸入框1<input type="text" name=""> 輸入框2<input type="text" name=""> 輸入框3<input type="text" name="" disabled> 輸入框4<input type="text" name=""> <select> <option>html</option> <option>css</option> <option selected="">JavaScript</option> <option>php</option> </select> 愛好: <label><input type="checkbox" name="">看書</label> <label><input type="checkbox" name="">游戲</label> <label><input type="checkbox" name="" checked>打球</label> </form> </body> </html>
Korrigierender Lehrer:查無此人Korrekturzeit:2019-04-19 09:15:39
Zusammenfassung des Lehrers:完成的不錯,每行jq代碼結束要增加;號。繼續(xù)加油。