<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head><body>
<table>
<tr onclick="alert(this.outerHTML)">
<td><textarea name="" rows="" cols=""></textarea></td>
<td><input type="checkbox" name=""></td>
<td></td>
</tr>
<tr>
<td><select name=""></select></td>
<td></td>
<td></td>
</tr>
</table>
</body>
</html>
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head><body>
<table>
<tr onclick="alert(this.outerHTML)">
<td><textarea name="" rows="" cols=""></textarea></td>
<td><input type="checkbox" name=""></td>
<td></td>
</tr>
<tr>
<td><select name=""></select></td>
<td></td>
<td></td>
</tr>
</table>
</body>
</html>
复制是为了方便用户使用!他们可能只想修改一点东西,所以copy原来的,然后改一点就可以了
楼上的先谢了,可是好像太简单了点,呵呵!
我得到了outerHTML,然后怎么插如到table里啊!能不能通过Table的id,然后用appendChild()的方式把他搞定呢?希望大家指点!!!
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content=""><script language="javascript">
function trAdd( str ) {
var tbl = document.getElementById("table1");
var row = tbl.insertRow(tbl.rows.length);
var cell = row.insertCell();
cell.innerHTML = str;
}
function check(obj){
if( obj.checked ){
var str = (document.getElementById("tr1")).innerHTML;
trAdd(str); }
}</script></head><body>
<table id="table1">
<tr id="tr1">
<td>aaaaa</td>
<td><input type="checkbox" name="c1" onclick="check(this)"></td>
</tr></table>
</body>
</html>