摘要:$(document).ready(function(){$(':enabled')所有激活的input元素(可以使用的input元素)$(':disabled')所有禁用的input元素(不可以使用input元素)$(':selected')所有被選定的元素 針對于select元素 selected
$(document).ready(function(){
$(':enabled')所有激活的input元素(可以使用的input元素)
$(':disabled')所有禁用的input元素(不可以使用input元素)
$(':selected')所有被選定的元素 針對于select元素 selected 是選定的意思 choice是選擇 selected已選定
$(':checked') 所有被選擇的input元素
//$(':enabled').css('background','pink')
//$(':disabled').css('background','red')
$(':selected').css('color','red')*/
$(':checked').parent().css('color','#f40')
})
-------------------------------------html-----------------------------
<from>
<!-- 輸入框1:<input type="" name=""><br><br>
輸入框2:<input type="" name=""><br><br>
輸入框3:<input type="" name="" disabled><br><br>
輸入框4:<input type="" name=""><br><br>
<br><br><br><br>
<select>
<option>馬云</option>
<option selected>劉強東</option>
<option selected>馬化騰</option>
<option>宇哥</option>
</select>-->
<br><br><br><br>
我的愛好:
<label><input type="checkbox" >看書</label>
<label><input type="checkbox" checked>寫字</label>
<label><input type="checkbox">打豆豆</label>
</from>
批改老師:滅絕師太批改時間:2019-03-04 15:41:50
老師總結(jié):可以跳出老師上課代碼,自己帶案例測試哦!