2

i want to know how to remove html tags from a string using jquery, html looks like this

var string = '<p><marquee> some text </marquee>/p>';

now i want to remove all html tags and just want the plain text from it.

thank you

0

3 Answers 3

5

jQuery text() will help you like this :

var willbeequaltosometext = $("marquee").text();
0
2

You could do this yust like this:

$('<p><marquee> some text </marquee></p>').text()
0
0

try:

alert($('<li>Some text...</li>').text());

Not the answer you're looking for? Browse other questions tagged or ask your own question.