I can't assign HTML properly using jQuery.tmpl(). If i pass value of something as html tag it is rendered as as it is instead of HTML tags rendered on page
<div id="window">
<script id="lines" type="text/x-jquery-tmpl">
<div id="${id}" class="line ${type}"><span>${name}</span>: ${body}</div>
</script>
</div>
var line = {
name: 'John',
body: '<strong>hello</strong>
};
$('#lines').tmpl(line).appendTo('#window');
You can wrap the template variable with {{html body}}
to override the default encoding behavior.
来源:https://stackoverflow.com/questions/6248962/how-to-render-html-as-rendered-html-in-jquery-tmpl