<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>jquery表单选择器</title> <script src="jquery/jquery-3.3.1.js" type="text/javascript" charset="utf-8"></script> <style type="text/css"> /* div{width: 100px;height: 100px;background: #ccc;margin-top: 20px;} */ </style> </head> <body> <script type="text/javascript"> $(document).ready(function(){ // $(':enabled').css('background','pink') // $(':disabled').css('background','red') // $(':selected').css('color','blue') $(':checked').parent().css('color','red') }) </script> <form> <lable>1</lable><input type="text" name="" /><br> <lable>2</lable><input type="text" name="" /><br> <lable>3</lable><input type="text" name="" disabled /><br> <lable>4</lable><input type="text" name="" /><br> <select name="" id=""> <option value ="">摩羯座</option> <option selected>双鱼座</option> <option value ="">射手座</option> <option value ="">天蝎座</option> </select> <br> 爱好 <lable><input type="checkbox" name="" />看书</lable> <lable><input type="checkbox" name="" checked/>游戏</lable> <lable><input type="checkbox" name="" />游泳</lable> </form> </body> </html>