回答編集履歴

2

コメントをより判りやすく修正

2015/08/21 07:03

投稿

hy3
hy3

スコア594

test CHANGED
@@ -22,7 +22,7 @@
22
22
 
23
23
 
24
24
 
25
- // ここでonclickイベントへ関数をバインドする
25
+ // ここで確認ボタンのonclickイベントへ関数をバインドする
26
26
 
27
27
  button.onclick = function() {
28
28
 

1

コードを少々リファクタリングした

2015/08/21 07:03

投稿

hy3
hy3

スコア594

test CHANGED
@@ -8,13 +8,13 @@
8
8
 
9
9
  var msg = document.createElement("input");
10
10
 
11
- var button = document.createElement("input");
11
+ msg.id = "msg";
12
-
13
-
14
12
 
15
13
  msg.setAttribute("type", "text");
16
14
 
15
+
16
+
17
- msg.setAttribute("id", "msg");
17
+ var button = document.createElement("input");
18
18
 
19
19
  button.setAttribute("type", "button");
20
20