How to make the text in the field was selected?

But not with the help of autofocus="autofocus" , but through JS, as it is implemented in VK when you click on your status.

    1 answer 1

    Maybe it ... just highlight or focus? these are different things. decide too

     document.getElementById("target-input-or-textfield").select();