回答編集履歴
1
追記
answer
CHANGED
@@ -20,4 +20,32 @@
|
|
20
20
|
</script>
|
21
21
|
</body>
|
22
22
|
</html>
|
23
|
+
```
|
24
|
+
|
25
|
+
**(追記)**
|
26
|
+
```HTML
|
27
|
+
<!DOCTYPE html>
|
28
|
+
<html lang="ja">
|
29
|
+
<head>
|
30
|
+
<meta charset="UTF-8">
|
31
|
+
<title>タイトル</title>
|
32
|
+
</head>
|
33
|
+
<body>
|
34
|
+
<div id="test"></div>
|
35
|
+
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
|
36
|
+
<script>
|
37
|
+
$(window).on("load", function () {
|
38
|
+
$("#test").append(
|
39
|
+
"<img src=\"123.jpg\">" +
|
40
|
+
"<img src=\"456.jpg\">"
|
41
|
+
);
|
42
|
+
});
|
43
|
+
|
44
|
+
$("#test").on("mouseover", "img", function () {
|
45
|
+
var src = $(this).attr("src");
|
46
|
+
alert(src);
|
47
|
+
});
|
48
|
+
</script>
|
49
|
+
</body>
|
50
|
+
</html>
|
23
51
|
```
|