I\'ve got an HTML:
1)TEXT THAT I ONLY NEEDsome par
..
I need only
well, if you use jQuery, you would do
$('.selector').text();
more info and examples here
edit: I just saw you want the text that is not in any tags - well this is not directly possible (fact is, that every text inside a html document is inside some HTML tags.)
In this case I would try to change the markup (easiest way), so the desired text is within html tags.
If this is not possible, you use the above mentioned text()
method to get the whole text from the parent element, and after you have to subtract the pieces you dont want.
see http://jsfiddle.net/3SSAR/1/ for an example of how to subtract the strings..
just remember to use substr
and not -
to subtract strings in javascript