I have a search bar on my nav, which shows after the search icon is clicked.
The issue is: I have set the autofocus on the search input, but it doesn’t seem to work somehow. Please see screenshots of the same.
PS: I tried adding this code and Div IDs are the same. Still doesn’t work.
(refer to screenshots)
Try making the class names all lowercase (Webflow converts to lowercase on publish)
Make sure your input exists/ is loaded before the script is executed, this could be why it is not focusing.
I’ve just tried it but still doesn’t work
OK so could you please add the custom code to make sure the input is loaded before the script?
You’re using jQuery, so you can just use jQuery’s on document ready.
I prefer the shorthand version, faster to type;