I have开发者_开发问答 this code :
<div id="example">
Hello
</div>
var string="example";
alert($(''+string).html());
but it should print "Hello" not null...why?
Try this.
alert($('#'+string).html());
I have开发者_开发问答 this code :
<div id="example">
Hello
</div>
var string="example";
alert($(''+string).html());
but it should print "Hello" not null...why?
Try this.
alert($('#'+string).html());
精彩评论