我試圖在動態生成的表後添加一個跨度,但跨度是在表的內容正在加載之前添加的。從動態生成的表後,從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