How to focus the input box on load with HTML?

Spread the love

Sometimes, we want to focus the input box on load with HTML.

In this article, we’ll look at how to focus the input box on load with HTML.

How to focus the input box on load with HTML?

To focus the input box on load with HTML, we add the autofocus attribute.

For instance, we write

<input type="text" autofocus />

to add the autofocus attribute to the innput to focus the input box on load.

Conclusion

To focus the input box on load with HTML, we add the autofocus attribute.

Leave a Reply

Your email address will not be published. Required fields are marked *