我是jQuery的新手,想知道是否有人能就最佳实践给予我建议...
我想把一个包含大量HTML的div元素附加到页面上,但不确定实现这个目标的最佳方式是什么......或者是否适合使用jquery...
例如,如果我想使用jQuery将以下代码附加到页面上,最好的方法是什么。
<div id="test">
<h1>This is the test</h1>
<p>Hello, just a test</p>
<a href="www.test.com">Click me</a>
<a href="www.test.com">Click me again</a>
</div>
$(array1.join('')) .appendTo('#test');
- namtax