我在本章当中学到了选择器的用法 也感觉自己好多都记不住 只是理解了
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
<script type="text/javascript" src="js/jquery-3.3.1.min.js"></script>
<style type="text/css">
</style>
</head>
<body>
<script type="text/javascript">
// 表单选择器
// 语法:
// $(':enabled')所有激活的input元素(可以使用的input元素)
// $(':disabled')所有禁用的input元素(不可以使用的input元素)
// $(':selected')所有被选取的元素,针对于select元素
// $(':checked')所有被选中的input元素
$(document).ready(function(){
// $(':enabled').css('background','red') //激活所有input元素 没有被禁用下的
// $(':disabled').css('background','#Ccc') //不可使用的input的元素 被禁用的元素
// $(':selected').css('background','#Ccc') //所有被选取的元素,针对于select元素
$('input:checked').parent().css('background','red')
})
</script>
输入框1<input type="text" name=""><br>
输入框2<input type="text" name="" disabled><br>
输入框3<input type="text" name=""><br>
输入框4<input type="text" name=""><br>
<select>
<option>1</option>
<option selected>2</option>
<option>3</option>
<option>4</option>
</select>
<label><input type="checkbox" name="">1</label>
<label><input type="checkbox" name="">2</label>
<label><input type="checkbox" name="" checked>3</label>
<label><input type="checkbox" name="">4</label>
</body>
</html>