I have a json object which has a value of html with styles. I tried including it in my html using jquery append.
the value is getting appending, but it is not converting into normal DOM, it is appending the whole thing as a string.
This is my JSON object value:
var obj = {
content : "<p><linkrel="stylesheet"type="text/css"href="http:<p><styletype="text/css"><br/>.wrap{<br/> background-color:#F6F6F6;<br/>}<br/></style></p><p><divclass="wrap"><br/> </div></p>"
}
This is what i tried:
HTML:
<div id='container'></div>
JS:
$('#container').append(obj.content);
Output should be a part of dom, instead it is printing the entire thing as a string.