From 8095b48bcc5b4e577d0ab73f844fa2fe8423c54f Mon Sep 17 00:00:00 2001 From: Ilya Kantor Date: Mon, 17 Jul 2017 12:24:00 +0300 Subject: [PATCH] fixed #90 --- 2-ui/2-events/04-default-browser-action/article.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/2-ui/2-events/04-default-browser-action/article.md b/2-ui/2-events/04-default-browser-action/article.md index 0472a818..652253e1 100644 --- a/2-ui/2-events/04-default-browser-action/article.md +++ b/2-ui/2-events/04-default-browser-action/article.md @@ -201,7 +201,6 @@ The object will catch any right-click, look through stored handlers and run the But then each piece of code that wants a context menu should know about that object and use its help instead of the own `contextmenu` handler. ``` - ## Summary There are many default browser actions: @@ -219,3 +218,13 @@ All the default actions can be prevented if we want to handle the event exclusiv To prevent a default action -- use either `event.preventDefault()` or `return false`. The second method works only for handlers assigned with `on`. If the default action was prevented, the value of `event.defaultPrevented` becomes `true`, otherwise it's `false`. + +```warn header="Stay semantic, don't abuse" +Technically, by preventing default actions and adding JavaScript we can customize the behavior of any elements. For instance, we can make a link `` work like a button, and a button `