jquery append

将已经存在的一个dom对象A,通过jquery append插入另一个dom对象B,将会改变dom树结构--即A成为了B的子元素。

举个例子:

js:

$(".table-container").append($(".table"));

 html:

        <div class="table-container"></div>
	<table id="table" class="table table-bordered">
		<thead>
			<tr>
				<th>测试</th>
			</tr>
		</thead>
	</table>

 效果如下:

操作前:

操作后:

原文地址:https://www.cnblogs.com/guxingzhe/p/5941565.html