javascript - Escape characters in String in a HTML page? -


i have string in below non-escaped format in html page:

<a href="http://somesite/product?page=blahk&id=ea393216&tabs=7,0&selections=quarter:q2+2013^&wicket:pagemapname=wicket-2\">something</a> 

what need use jquery/javascript replace string link "something".

i have looked @ examples in stackoverflow, don't seem work. i'm getting started jquery , javascript, appreciate here.

any ideas?

try html() , text() in jquery decode:

var str = '&lt;a href="http://somesite/product?page=blahk&id=ea393216&tabs=7,0&selections=quarter:q2+2013^&wicket:pagemapname=wicket-2\">something&lt;/a>';    var decoded = $('<div />').html(str).text();   alert($(decoded).text()); 

see fiddle demo


Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

php - Dynamic url re-writing using htaccess -

java - Multi-Label Document Classification -