Skip to content

Instantly share code, notes, and snippets.

@codingwithsara
Created November 9, 2018 13:35
Show Gist options
  • Save codingwithsara/e48b4913393dbe0f27cb020922783349 to your computer and use it in GitHub Desktop.
Save codingwithsara/e48b4913393dbe0f27cb020922783349 to your computer and use it in GitHub Desktop.
【jQuery】テーブル Tr 行を動的に追加・削除・並び替え・値を取得する方法
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>テーブル追加</title>
<style>
.container {
width: 500px;
margin: 100px auto;
}
input {
width: 300px;
font-size: 18px;
margin: 10px;
padding: 10px;
}
.remove {
width: 30px;
height: 30px;
font-size: 20px;
background-color: tomato;
color: white;
border: none;
border-radius: 15px;
}
#addRow, #getValues {
width: 130px;
height: 40px;
font-size: 16px;
background-color: lightseagreen;
color: white;
border: none;
margin: 20px;
}
button:hover {
cursor: pointer;
}
tr:hover {
cursor: move;
}
</style>
</head>
<body>
<!-- 省略 -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment