<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<script>
$(this).select(function(){
var a = $(this).prevUntil('p').html;
console.log(a);
});
</script>
<html>
<p>dfdsf
dsfdsf
<span>sdfdsfds</span><a >sdfdsfdsfdsf</a>sdfsdfdsfdsfds
fsd
f
ds
f
ds
fd</p>
</html>
我需要从光标选择位置到第一个父级div
或p
.