JavaScript implements the method of automatically selecting TextArea text by clicking on it


This article illustrates JavaScript’s method of automatically selecting TextArea text by clicking on it. Share to everybody for everybody reference. Specific implementation methods are as follows:

<textarea rows="10" cols="50" onclick="this.focus();this.select()"
readonly="readonly">
  example text
</textarea>

Hopefully, this article has been helpful in your javascript programming.