jQuery: HTML Encode Trick

June 17th, 2009 by jeremychone
$('<div/>').text('This is fun & stuff').html();

Source: debuggable.com

One Response to “jQuery: HTML Encode Trick”

  1. ww Says:

    $(”).text(’This is fun & stuff’).html();

Leave a Reply