jquery学习(二)
console.log(e1.get(2));
二通过关系查找jquery对象的方法
<div id="box">
<div>
<div>
<p id="info">lorm ipsum doror</p>
</div>
</div>
</div>
var e1 = $('.item-4').next('li');
var e2 = $('.item-4').nextAll('li');
var e3 = $('.item-4').nextUntil('item-6');
![](https://images2018.cnblogs.com/blog/1337624/201803/1337624-20180305172309686-239953551.png)
布尔值设置的是属性(prop)
<img id="logo" src='logo.jpg' alt="jquery logo" class="img-jquery" title="jquery logo" />
<img id="logo1" src='logo.jpg' alt="jquery logo1" class="img-jquery1" title="jquery logo1" />
<input type="checkbox" id="check" tabindex='1' style= "width:50px;height:50px" title="check this" description = "just a checkbox"/>
<!-- <ul>
var img = $('img');
var checkbox = ('#check'); //jquery 对象
e1 = img.attr('src'); //logo.jpg
e2 = img.attr('title','jquery logo3'); //img1,img2 all changed to "jquery logo3"
console.log(checkbox.prop('checked')); //boolan获取特殊属性值
console.log(checkbox.get(0).checked); //jquery对象转换为dom对象才能取到值
console.log(checkbox.attr('checked'));
checkbox.removeProp('title') //内置属性删除后变成undefined,特性变成undefined