Jquery: Get Text Between Two
Elements
i've got a HTML tree like this:
This is line 1 This is line 2 This is line 3 This is line 4).map(function(){
returnthis.previousSibling.nodeValue;
});
alert(text[0]);
Solution 2:
You can use previousSibling
property:
document.getElementById('marker').previousSibling;
previousSibling
returns an object, if you want to get the text content of it, you can use textContent
, nodeValue
or wholeText
property.
Solution 3:
nextUntil will help you.. check out the link
Post a Comment for "Jquery: Get Text Between Two
Elements"