Maarten Wolfsen Maarten Wolfsen - 9 months ago 30
HTML Question

Direct user to input field, when button is clicked

I have a search icon. When this icon is clicked, a full screen search form pops up.

What I want, is when the user clicks on this icon and the search form appears, that the user goes directly to the input field. (that the focus is on this field, and the user can type away immediately).

(I have no idea how to formulate this correctly, so that might be why I could not find any question related)


Maybe this link from jQuery will help you out:

And the part of code inside the onclick event of search icon would be similar to this:

$(document).on("click","#searchIcon",function() {

Hope it helps you