diff --git a/2-ui/2-events/02-bubbling-and-capturing/article.md b/2-ui/2-events/02-bubbling-and-capturing/article.md index 5d854a59f..9cf32e4ed 100644 --- a/2-ui/2-events/02-bubbling-and-capturing/article.md +++ b/2-ui/2-events/02-bubbling-and-capturing/article.md @@ -1,24 +1,24 @@ -# Bubbling and capturing +# Бульбашковий механізм (спливання та занурення) -Let's start with an example. +Давайте почнемо з прикладу. -This handler is assigned to `
`, but also runs if you click any nested tag like `` or ``: +Цей обробник для `
` спрацює, якщо ви клікнете по будь-якому з вкладених тегів, чи то ``, чи то ``: ```html autorun height=60 -
- If you click on EM, the handler on DIV runs. +
+ Якщо ви клікнете EM, обробник спрацює на DIV .
``` -Isn't it a bit strange? Why does the handler on `
` run if the actual click was on ``? +Чи не дивно? Чому виконується обробник на `
`, якщо фактичний клік був на ``? -## Bubbling +## Спливання -The bubbling principle is simple. +Принцип Спливання простий. -**When an event happens on an element, it first runs the handlers on it, then on its parent, then all the way up on other ancestors.** +**Коли подія відбувається на елементі, спочатку запускаються обробники на ньому, потім на його батькові, потім на інших предках і так до самого верху.** -Let's say we have 3 nested elements `FORM > DIV > P` with a handler on each of them: +Скажімо у нас є 3 вкладені елементи `FORM > DIV > P` з обробником на кожному з них: ```html run autorun