Remove html tags from string using jquery [duplicate]
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 an开发者_StackOverflowd just want the plain text from it.
thank you
jQuery text() will help you like this :
var willbeequaltosometext = $("marquee").text();
You could do this yust like this:
$('<p><marquee> some text </marquee></p>').text()
try:
alert($('<li>Some text...</li>').text());
精彩评论