回答編集履歴

1

追記

2017/12/16 21:28

投稿

s8_chu
s8_chu

スコア14731

test CHANGED
@@ -43,3 +43,59 @@
43
43
  </html>
44
44
 
45
45
  ```
46
+
47
+
48
+
49
+ **(追記)**
50
+
51
+ ```HTML
52
+
53
+ <!DOCTYPE html>
54
+
55
+ <html lang="ja">
56
+
57
+ <head>
58
+
59
+ <meta charset="UTF-8">
60
+
61
+ <title>タイトル</title>
62
+
63
+ </head>
64
+
65
+ <body>
66
+
67
+ <div id="test"></div>
68
+
69
+ <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
70
+
71
+ <script>
72
+
73
+ $(window).on("load", function () {
74
+
75
+ $("#test").append(
76
+
77
+ "<img src=\"123.jpg\">" +
78
+
79
+ "<img src=\"456.jpg\">"
80
+
81
+ );
82
+
83
+ });
84
+
85
+
86
+
87
+ $("#test").on("mouseover", "img", function () {
88
+
89
+ var src = $(this).attr("src");
90
+
91
+ alert(src);
92
+
93
+ });
94
+
95
+ </script>
96
+
97
+ </body>
98
+
99
+ </html>
100
+
101
+ ```