我试图在动态生成的表后添加一个跨度,但跨度是在表的内容正在加载之前添加的。从动态生成的表后,从jQuery插入跨度
下面是我的代码:
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>
$(document).ready(function(){
dash();
$("button").click(function(){
$("#th").append("<span>span</span>");
});
});
function dash()
{
$("#hu").html();
$("#hu").append("<tr> <td> see this </td> </tr>");
}
</script>
</head>
<body>
<button>Insert content after each p element</button>
<div align="right" id="th">
<table id="hu" align="right">
<tr><td>hello</td></tr>
</table>
</div>
</body>
</html>
跨度是越来越你好前加入。我希望跨度显示在表格内容之后。
如果此链接hello' – guradio
后我出现'是什么'$目的( “#胡”)HTML();'在功能上破折号() – Reoxey
不允许表使用align =“right” – Afsar