回答編集履歴
2
びちょうせい
answer
CHANGED
@@ -18,7 +18,7 @@
|
|
18
18
|
<script>
|
19
19
|
$(function(){
|
20
20
|
$("a.head h3").on("click", function (e) {
|
21
|
-
if(e.
|
21
|
+
if(e.target.nodeName=="H3"){
|
22
22
|
console.log("iのアイコンをクリックしても実行されないように書きたい。");
|
23
23
|
}
|
24
24
|
})
|
1
chousei
answer
CHANGED
@@ -12,4 +12,21 @@
|
|
12
12
|
<i class="fas fa-question-circle" data-toggle="tooltip" data-placement="top" title="tooltip"></i>
|
13
13
|
</h3>
|
14
14
|
</a>
|
15
|
+
```
|
16
|
+
- 調整版
|
17
|
+
```javascript
|
18
|
+
<script>
|
19
|
+
$(function(){
|
20
|
+
$("a.head h3").on("click", function (e) {
|
21
|
+
if(e.originalEvent.target.nodeName=="H3"){
|
22
|
+
console.log("iのアイコンをクリックしても実行されないように書きたい。");
|
23
|
+
}
|
24
|
+
})
|
25
|
+
});
|
26
|
+
</script>
|
27
|
+
<a class="head">
|
28
|
+
<h3>見出し
|
29
|
+
<i class="fas fa-question-circle" data-toggle="tooltip" data-placement="top" title="tooltip">x</i>
|
30
|
+
</h3>
|
31
|
+
</a>
|
15
32
|
```
|