87,989
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="http://code.jquery.com/jquery-1.6.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
function addnewRows() {
$("table tr").eq(0).after('<tr><td>fuck the world</td></tr>');
}
function removenewRows() {
$("table tr").eq(1).remove();
}
</script>
</head>
<body>
<table>
<tr><td>hello world</td></tr>
<tr><td><input type='button' value="添加" onclick="addnewRows()"><input type='button' value="删除" onclick="removenewRows()"></td></tr>
</table>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="http://code.jquery.com/jquery-1.6.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
function addnewRows() {
$("table tr").eq(0).after('<tr><td>fuck the world</td></tr>');
alert($("table").html());
}
</script>
</head>
<body>
<table>
<tr><td>hello world</td></tr>
<tr><td><input type='button' value="Btn" onclick="addnewRows()"></td></tr>
</table>
</body>
</html>