How To Set Focus With JavaScript

preview_player
Показать описание
In this tutorial, you'll learn how to set the focus of an HTML input element with JavaScript.

To set the focus of an HTML input element is to direct the user's attention and more specifically their next user input to that element.

This can be useful when the user is completing a form and you need to jump to a specific part of the form or you just need to redirect their attention to an individual element. An example might be when they've incorrectly completed part of the form and they need to go back and update it.

In the tutorial, you'll see how to set the focus of an HTML input element with the JavaScript focus function and also how to lose this focus by using the JavaScript blur function. Channel Handle @codebubb
Рекомендации по теме
Комментарии
Автор

Very thanks! I'm from brazilliam! I like you video.

edoardopazz
Автор

This is all based on clicking event. What if I want a function inside a script to get the certain element in focus, without using addEventListener?

MrBojo-jvqq
visit shbcf.ru