Home > Article > Web Front-end > What is blur in javascript
Blur in JavaScript means losing focus; when the user clicks on a text input box with the mouse, a focus will be generated accordingly, and when the user clicks elsewhere, the cursor disappears and the text box disappears. Lost focus.
The operating environment of this article: windows7 system, javascript version 1.8.5, DELL G3 computer
What is blur in javascript?
Specific questions:
For example, what does this.blur() do? What does it mean to lose focus or move out of focus?
Analysis:
blur() means losing focus. Simply put, when you click the page with the mouse, a focus will be generated accordingly. For example, if you click on a text input box, the cursor will move there. At this time, the text box will gain focus. When you click elsewhere, the cursor will disappear and the text box will lose focus.
When you click on a hyperlink, a dotted line will appear around the hyperlink, and it will also gain focus.
The two examples mentioned above are simple and visible elements. There are many invisible elements or containers that can also get focus, such as SPAN, DIV, P, etc., after you click You don't see the page changing, but it actually gets focus.
Recommended study: "javascript Advanced Tutorial"
The above is the detailed content of What is blur in javascript. For more information, please follow other related articles on the PHP Chinese website!