Skip to content Skip to sidebar Skip to footer

Jquery .html Shows Html Tags Instead Of Applying Html Tags On The Text

My code is printMsg : function(data) { $('#message').html(data.bodyText); ... } here data.bodyText = <strong> Test This Text ;/strong> I

Solution 1:

are you trying to do something like this? in jquery 1.10.1 it seems work normally

HTML

<span id='message'></span>

JS

vardata = {};
data.bodyText = "<strong>Test This Text;</strong>"; 
$("#message").html(data.bodyText);

Post a Comment for "Jquery .html Shows Html Tags Instead Of Applying Html Tags On The Text"