Peter Peter - 6 months ago 7x
Javascript Question

Remove all HTMLtags in a string (with the jquery text() function)

is it possible to use the jquery text() function to remove all HTML in a string?

String with HTML tags:

myContent = '<div id="test">Hello <span>world!</span></div>';

The result must be:
Hello world!

var myContent = '<div id="test">Hello <span>world!</span></div>';


That results in hello world. Does that answer your question? for an example