Check out example codes for "select all text in textarea javascript". It will help you in understanding the concepts better.

Code Example 1

<textarea onclick="this.focus();this.select()">

Learn ReactJs, React Native from akashmittal.com