32
rated 0 times
[
33]
[
1]
/ answers: 1 / hits: 42236
/ 8 Years ago, fri, january 20, 2017, 12:00:00
I'm trying to render some HTML on the fly in my website without success. I've tried using jQuery's .html() function as below:
My html
<div id='open_ender_output'></div>
My JQuery
var openEnderContent = <p><span style=color: #ff0000;>DDD</span>!!!!!<strong>666666666666</strong></p>
//openEnderContent comes from my backend
$('#open_ender_output').html(openEnderContent)
The result is
<p><span style=color: #ff0000;>DDD</span>!!!!!<strong>666666666666</strong></p>
Is there a way to make the browser render that result on the fly so it reflects the specific styles set on the text?
More From » jquery