Set Focus to an DOM Input Field

How is it possible to select an input field directly by code, so that you can start typing right away?

I have tried the following commands without success:

input.focus();‘focus’, true);‘focus’, ‘true’);‘focus()’, ‘true’);

I would be very happy about a clue!

Thanks a lot. And Yes it is a pity that “autofocus()” is pretty much useless when it’s set inside p5.js.