Skip to content

Instantly share code, notes, and snippets.

@codingwithsara
Created November 9, 2018 23:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codingwithsara/1b7e3945a7712052215d5b026131a2d3 to your computer and use it in GitHub Desktop.
Save codingwithsara/1b7e3945a7712052215d5b026131a2d3 to your computer and use it in GitHub Desktop.
【jQuery】テーブル Tr 行を動的に追加・削除・並び替え・値を取得する方法
<!-- 省略 -->
<script>
$(function(){
$('tbody').sortable();
$('#addRow').click(function(){
var html = '<tr><td><input type="text" name="name"></td><td><button class="remove">-</button></td></tr>';
$('tbody').append(html);
});
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment