Skip to content

Commit 4550b60

Browse files
Update article.md
1 parent b0624a1 commit 4550b60

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

2-ui/4-forms-controls/2-focus-blur/article.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Focusing: focus/blur
22

3-
An element receives a focus when the user either clicks on it or uses the `key:Tab` key on the keyboard. There's also an `autofocus` HTML attribute that puts the focus into an element by default when a page loads and other means of getting a focus.
3+
An element receives the focus when the user either clicks on it or uses the `key:Tab` key on the keyboard. There's also an `autofocus` HTML attribute that puts the focus onto an element by default when a page loads and other means of getting the focus.
44

55
Focusing on an element generally means: "prepare to accept the data here", so that's the moment when we can run the code to initialize the required functionality.
66

@@ -18,7 +18,7 @@ Let's use them for validation of an input field.
1818

1919
In the example below:
2020

21-
- The `blur` handler checks if the field the email is entered, and if not -- shows an error.
21+
- The `blur` handler checks if the field has an email entered, and if not -- shows an error.
2222
- The `focus` handler hides the error message (on `blur` it will be checked again):
2323

2424
```html run autorun height=60
@@ -108,7 +108,7 @@ By default many elements do not support focusing.
108108

109109
The list varies a bit between browsers, but one thing is always correct: `focus/blur` support is guaranteed for elements that a visitor can interact with: `<button>`, `<input>`, `<select>`, `<a>` and so on.
110110

111-
From the other hand, elements that exist to format something, such as `<div>`, `<span>`, `<table>` -- are unfocusable by default. The method `elem.focus()` doesn't work on them, and `focus/blur` events are never triggered.
111+
On the other hand, elements that exist to format something, such as `<div>`, `<span>`, `<table>` -- are unfocusable by default. The method `elem.focus()` doesn't work on them, and `focus/blur` events are never triggered.
112112

113113
This can be changed using HTML-attribute `tabindex`.
114114

@@ -131,7 +131,7 @@ There are two special values:
131131
For instance, here's a list. Click the first item and press `key:Tab`:
132132

133133
```html autorun no-beautify
134-
Click the first item and press Tab. Keep track of the order. Please note that many subsequent Tabs can move the focus out of the iframe with the example.
134+
Click the first item and press Tab. Keep track of the order. Please note that many subsequent Tabs can move the focus out of the iframe in the example.
135135
<ul>
136136
<li tabindex="1">One</li>
137137
<li tabindex="0">Zero</li>
@@ -216,7 +216,7 @@ So here's another working variant:
216216

217217
## Summary
218218

219-
Events `focus` and `blur` trigger on focusing/losing focus on the element.
219+
Events `focus` and `blur` trigger on an element focusing/losing focus.
220220

221221
Their specials are:
222222
- They do not bubble. Can use capturing state instead or `focusin/focusout`.

0 commit comments

Comments
 (0)