I have placed a span inside of the paragraph tag, now the position top should show as 0 and the offset should show some other value (need to calculate from document), but i am getting the same value in both...
i am wrong?
this is my code:
HTML:
<div></div>
<p>paragraph<span>span</span>paragraph</p>
Jquery:
$('span').click(function(){
console.log($(this).position().top,$(this).offset().top)
})
CSS:
p{
color:green;
}
span{
color:red;
}
div{
height:100px;
border:2px solid blue;
}