We all seem to be looking for acceptance in one way or another. We look for acceptance (love, approval) from friends, business associates, family, and sometimes even strangers. We look at social…
Use the autofocus
attribute on form elements to automatically focus the input field when the page loads 👍
This is super handy if your site has a form and you can automatically select the first input field and your user can start typing right away 👏
For example, if you have a search site like google, you can use this attribute to automatically select the search field. That way your user can start typing immediately without needing to click on the input field first. Yay, awesome User Experience 🤩
You can apply the autofocus
attribute on:
Note you can’t apply autofocus
on inputs of type hidden
because hidden inputs can't be focused.
Also, autofocus
can only be on one element on one page. So don't use it on multiple elements.
I’ll be remiss not to mention some of the accessibility concerns of autofocus
. So please keep this in mind before using this attribute.
I also want to point a possible solution of using aria-describedby
that may help with this. Of course, if you know of any other solutions, please do share!
When this alert loads, the autofocus
is kicked in to automatically select the "Do not delete" button. However, due to the limitation of autofocus
for screen readers. This is not ideal for accessibility. A possible solution is to utilize the aria-describedby
attribute. So the screen reader will now announce: "Are you sure? dialog. Once you delete this thing, it’s gone forever! Do not delete, button."
Optimized for different use-cases, NFC tags and QR-Codes each have their strengths and weaknesses. Here we break down each technology, what it does well, what it lacks, and where each works best…
website seo check list
As soon as it grew dark, I took off in our neighborhood, running with scissors. My quest was to bring home the prettiest bouquet for my mother. I was 10. With scissors in one hand, I ran to and fro…