jquery选择器

Original 2018-11-12 18:46:08 208
abstract:<!DOCTYPE html><html><head><meta charset="utf-8"> <title>jQuery选择器</title> <script type="text/javascript"src="jquery-3.3.1.min.js"&

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8">

<title>jQuery选择器</title>

<script type="text/javascript"src="jquery-3.3.1.min.js"></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>

 输入框1<input type="text" name=""><br>

 输入框2<input type="text" name=""><br>

 输入框3<input type="text" name="" disabled><br>

 输入框4<input type="text" name=""><br>

 <select>

   <option>摩羯座</option>

   <option selected>双鱼座</option>

   <option>射手座</option>

   <option>天蝎座</option>

 </select>

 <br>

 爱好:

 <label><input type="checkbox" name="">泡妞</label>

 <label><input type="checkbox" name="" checked>喝酒</label>

 <label><input type="checkbox" name="">赚钱</label>

</form>

</body>

</html> 


Correcting teacher:灭绝师太Correction time:2018-11-12 19:07:26
Teacher's summary:选择器这一块好要好好掌握哦……后面非常重要

Release Notes

Popular Entries