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="ment"></label>
And here's how I'm working with it in javascript:
var ment;
ment = $("#ment");
ment.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
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="ment"></label>
And here's how I'm working with it in javascript:
var ment;
ment = $("#ment");
ment.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
Share Improve this question asked Sep 13, 2012 at 14:28 goalie35goalie35 7864 gold badges17 silver badges37 bronze badges3 Answers
Reset to default 6Use the html function :
ment.html("<b>Please scan an <br/>item!</b>");
try ment.html("<b>Please scan an <br/>item!</b>");
You could also use document.getElementById("ment").innerHTML = "<b>Please scan an <br/>item!</b>";
ment.html("<b>Please scan an <br/>item!</b>");
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744252736a4565246.html
评论列表(0条)