If I want to set the text of a to \"Test message here\", do I do:
$(\'\').text(\'Test
You create a new div and set its text, but you don't insert it anywhere. What you need to do is:
var el = $('').text('Test message here'); $(document).append(el); or, if the div is already there: $("#error").text('Test message here'); 0 讨论(0) 查看其它4个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复
or, if the div is already there:
$("#error").text('Test message here');