0. HTML对象和jQuery对象的区别:
1.jQuery对象转换成DOM对象,用索引取出具体的标签
2.DOM对象转换成jQuery对象,$(DOM对象)
注意:jQuery对象保存到变量的时候,变量名要加$前缀
1.基本筛选器:
<!--筛选器-->
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
</ul>
<!--not-->
<div id="d2">
<p class="c1">样式名:c1</p>
<p class="c1">样式名:c1</p>
<p class="c2">样式名:c2</p>
<p class="c2">样式名:c2</p>
</div>
<!--has-->
<div id="d3">
<div style="background-color:green;">
<a href="" rel="external nofollow" rel="external nofollow" >div中的a标签</a>
</div>
<div style="background-color:red;">
<a href="" rel="external nofollow" rel="external nofollow" >div中的a标签</a>
</div>
</div>
属性选择器:
<!--属性选择器-->
<form action="" id="f1">
<lable>用户名:<input type="text" name="username"></lable> <lable>密码:<input type="password" name="pwd"></lable> <lable>篮球:<input type="checkbox" name="hobby" value="basketball" ></lable> <lable>足球:<input type="checkbox" name="hobby" value="football"></lable> <lable>男:<input type="radio" name="gender" value="0"></lable> <lable>女:<input type="radio" name="gender" value="1"></lable></form>
上面表单简写筛选器:
:text
:password
:file
:radio
:checkbox
:submit
:reset
:button
表单对象属性:
:enabled
:disabled
:checked
:selected
<lable>用户名:<input type="text" name="username" disabled></lable>