-
-
Save codingwithsara/8a28e6ab3e4cdb7ad92f1ca82e2e1d02 to your computer and use it in GitHub Desktop.
【jQuery】テーブル Tr 行を動的に追加・削除・並び替え・値を取得する方法
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="utf-8"> | |
<title>テーブル追加</title> | |
</head> | |
<body> | |
<div class="container"> | |
<table> | |
<tbody> | |
<tr> | |
<td><input type="text" name="name"></td> | |
<td><button class="remove">-</button></td> | |
</tr> | |
<tr> | |
<td><input type="text" name="name"></td> | |
<td><button class="remove">-</button></td> | |
</tr> | |
</tbody> | |
</table> | |
<button id="addRow">+ 追加</button> | |
<button id="getValues">値を取得</button> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment