/ Published in: JavaScript
You need jQuery to make this work.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/* Sample Usage * var encodedHTML = '<a href="http://link.com">text</a>'; * var decodedHTML = html_decode(encodedHTML); */ var html_decode = function(h){ return $('<p>'+h+'</p>').text(); }