Reputation: 786
I have a "Label" control on my form which is being populated via jquery. My problem however, is I need to return my string with html tags, but my label doesn't seem to recognize html. Here's my control:
<label id="comment"></label>
And here's how I'm working with it in javascript:
var comment;
comment = $("#comment");
comment.text("<b>Please scan an <br/>item!</b>");
In the above code, the html in my string is ignored. Is there any way I can get my form to recognize the returned html tags?
Thanks
Upvotes: 0
Views: 3608
Reputation: 28722
try comment.html("<b>Please scan an <br/>item!</b>");
You could also use document.getElementById("comment").innerHTML = "<b>Please scan an <br/>item!</b>";
Upvotes: 3
Reputation: 382150
Use the html function :
comment.html("<b>Please scan an <br/>item!</b>");
Upvotes: 6