I'm trying to print plain html from javascript and can't figured out how to do so. Example:
$('#elem').html('This is a normal string'); // --> This is a normal string
$('#elem').html('This <b>contains</b> html')
//Current-> This contains html (contains is bold)
//Wanted-> This <b>contains</b> html
I want to do this because I'm working with comments written by users and don't want html tags to apply if they put some in their comments. But for other reasons I need to see the tags.
Thanks for your help!