获取位置

获取标签位置:1.
var position = $('p').position();
$('p').html('left:'+position.left+',top:'+position.top)

获取区域高度:
2.$('p').text('innerHeight:'+$('p').innerHeight())
3.$('p').text('outerHeight:'+$('p').outerHeight()+',outerHeight(true):'+$('p').outerHeight(true):)

4.$('p').wrapInner(document.createElement('b'))//对标签内的文字进行加粗
5.<p>Hello</p>how are<p>you?</p>
$('p').detach();从DOM中把所有元素删除
6.<p class="hello">hello</p>how are<p>you?</p>
$('p').detach('.hello');从DOM中把含有hello类的段落删除
7.$('li').filter('.dd').css('color','red')
8.$('li').parent('').is('ol')若li里为ol,则返回true

原文地址:https://www.cnblogs.com/rockyan/p/7992919.html