<div>
<p>Something_1</p>
<p>Something_2</p>
<p class="foo">Something_3</p>
</div>
<script>
function ReturnValue(){
var countElem = $('.foo').prev('p').length
+$('.foo').prevAll('p').length
+$('.foo').prevUntil('div').length;
console.log(countElem);
};
ReturnValue();
</script>
What will be printed to the console?
Login in to like
Login in to comment