javascript - strip span tags from string with jquery -


I want to take text value of the AP tag when I enter

  $ Keynav.enterDown = function () with {var = $ ('# suggestion p.keynavon'). Html (); Warning (relaxing and relaxing time); }  

This is working very well but in result and gt; Tags are tags, anyway can I strip those tags with string?

"post-text" itemprop = "text">

If you want the text now, instead of after it, use it:

  $ Keynav.enterDown = function () with {var = $ ('# suggestion p.keynavon'). Text (); Warning (relaxing and relaxing time); }  

If you actually receive & lt; Span & gt; If the tag needs to be specifically stripped, clone the content (as it does not affect the original) and through their internal content, like this:

  $ Keynav.enterDown = function () with {var = $ ('# suggestion p.keynavon'). Clone () Find ('span') .replaceWith (function () {return.innerHTML;}) .end () Html (); Warning (relaxing and relaxing time); }  

Comments