95 In HTML, you use boolean attributes with or without values as you like. A boolean, for W3C, like autofocus can be written like that autofocus or autofocus="autofocus" or also autofocus="". If you don't want autofocus just don't write it.

Context Explanation

I think you are confused because XHTML requires values for all attributes: attributes="values". Autofocus not working on open form dialog with button component in Material UI v5 Asked 3 years, 1 month ago Modified 1 year, 11 months ago Viewed 11k times reactjs - Autofocus not working on open form dialog with button ... javascript - How do I make a field autofocus? - Stack Overflow autofocus attribute does work only on initial DOM page load.

Insight Material

DOES NOT work on DOM changes (example : when you have component that will refresh DOM and apply new HTML autofocus will not work) It works with dynamic content only first time initiated. My case study was setting up focus on first result from api response so when user clicks next to load more results autofocus will not work. AutoFocus doesn't work in React Asked 8 years ago Modified 3 years, 7 months ago Viewed 31k times Autofocus processing was blocked because a document already has a focused element. So now the question is: How can I get the focus to the textarea when some other element already has it? How to give autofocus to a element when another element has it?

Final Conclusion