You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 2-ui/2-events/02-bubbling-and-capturing/article.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,26 +44,26 @@ Sebuah klik pada bagian dalam `<p>` akan menjalankan `onclick`:
44
44
45
45
Jadi jika kita klik pada `<p>`, kemudia kita akan melihat 3 buah peringatan (_alerts_): `p` -> `div` -> `form`.
46
46
47
-
The process is called "bubbling", because events "bubble" from the inner element up through parents like a bubble in the water.
47
+
Proses ini disebut dengan "menggelembung (_bubbling_)", karena peristiwa akan "mengelembung (_bubble_)" dari bagian dalam elemen ke atas melalui elemen orang tua (_parents_) seperti sebuah gelembung di air.
48
48
49
-
```warn header="*Almost* all events bubble."
50
-
The key word in this phrase is "almost".
49
+
```warn header="*Hampir* semua peristiwa bergelembung."
50
+
Kata kunci pada kata tersebut adalah "hampir".
51
51
52
-
For instance, a `focus` event does not bubble. There are other examples too, we'll meet them. But still it's an exception, rather than a rule, most events do bubble.
52
+
Contohnya, peristiwa `focus` tidak bergelembung. Masih ada contoh lain, kita akan membahas mereka. Tapi tetap itu hanya pengecualian, dan bukan aturan baku, hampir semua peristiwa mengelembung.
53
53
```
54
54
55
55
## event.target
56
56
57
-
A handler on a parent element can always get the details about where it actually happened.
57
+
Sebuah penangan (_handler_) pada elemen orang tua bisa selalu mendapat detail tentang dimana kejadian itu terjadi.
58
58
59
-
**The most deeply nested element that caused the event is called a *target*element, accessible as`event.target`.**
59
+
**elemen bersarang yang mengakibatkan peristiwa (_event_) di panggil di sebut sebuah *target*elemen, diakses dengan menggunakan`event.target`.**
60
60
61
-
Note the differences from`this` (=`event.currentTarget`):
-`event.target` -- is the "target" element that initiated the event, it doesn't change through the bubbling process.
64
-
-`this` -- is the "current" element, the one that has a currently running handler on it.
63
+
-`event.target` -- adalah "target" elemen yang menginisialisasi peristiwa (_event_), dan tidak berubah pada proses pengelembungan.
64
+
-`this` -- adalah elemen tersebut, elemen yang sedang menjalankan penangan (_handler_).
65
65
66
-
For instance, if we have a single handler `form.onclick`, then it can "catch" all clicks inside the form. No matter where the click happened, it bubbles up to `<form>`and runs the handler.
66
+
Contohnya, jika sebuah penangan (_handler_) `form.onclick`, kemudian form itu akan "menangkap" semua klik yang terjadi didalam form. Tidak peduli dimana klik itu terjadi, klik itu akan mengelembung ke `<form>`dan akan menjalankan penangan (_handler_).
0 commit comments