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();
Sign up to request clarification or add additional context in comments.

Comments

2

You could do this yust like this:

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

Comments

0

try:

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.