javascript - jQuery .append() not rendering html entity -


i have variable html in this:

var html = '<div>hello, you&#39;re awesome!</div>'; 

i want append element $("body").append(html) reason it's not decoding html entity. tried $("body").append($(html)); , didn't work. text stuck inside element , can't individually put together.

is there way append html text-based entity inside element, , have html entity render on page?

i've read bunch of posts on stackoverflow reguarding html entities , seems none of them include html & text within variable this.

try this:

var html = $('<div>hello, you&#39;re awesome!</div>'); $("body").append(html) 

demo here


Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

java Extracting Zip file -

C# WinForm - loading screen -