2つのテーブルがあります。テーブル1とテーブル2。ボタンの代わりにその行をクリックすると、 java-scriptを使用します。javascriptを使用してテーブルの1つの行から別のテーブル行にコンテンツを移動する方法
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("button").click(function(){
$("t1").clone().appendTo("t2");
});
});
</script>
</head>
<body>
<table style="width:100%;border-style:dashed">
<tr1>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr1>
</table>
</br>
<table style="width:100%;border-style:dashed">
<tr2>
<th></th>
<th></th>
<th></th>
</tr2>
</table>
<button>colne</button>
</body>
</html>
codepen例が与えられるならば、私は感謝します。
試したスクリプトを共有できますか? –
私はここに新しいと私はスクリプトを共有する方法を知らない。 –
コード例があるとわかります..... –