One line html decode entities (jQuery)


/ Published in: JavaScript
Save to your folder(s)

You need jQuery to make this work.


Copy this code and paste it in your HTML
  1. /* Sample Usage
  2. * var encodedHTML = '<a href="http://link.com">text</a>';
  3. * var decodedHTML = html_decode(encodedHTML);
  4. */
  5.  
  6. var html_decode = function(h){ return $('<p>'+h+'</p>').text(); }

URL: http://tomasdev.com.ar

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.