How do you NOT focus on any text input fields in the form after the page loads?

I have a form loaded in a simple module overlay, but it focuses on the first input field. In any case, so that the form does not focus (which means that the field is selected, and the user can immediately enter it without having to click it) in any text input field after loading the form?

+3
source share
4 answers

in jquery:

when you add the form, follow these steps:

$('input').each(function(){ $(this).blur(); });
+6
source
$(function () {
    $('input').blur();
});
+7
source
$(function () {
    $('form input').blur();
});
0
source

Source: https://habr.com/ru/post/1766030/


All Articles