开发者

how to use jquery to creat self-closing label?

I tried this:

$('<input class="inputName" type="text" />').appendTo($('body'))

but it turns out

&开发者_StackOverflow中文版lt;body><input class="inputName" type="text"></body>

Is there a way to creat the proper self-closing label?


What you are doing is in fact correct. Ensure your DOCTYPE is XHTML.

Edit: You don't have to worry about any of this since the code won't pass through validators anyway (validators do not execute javascript).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜