How to select Auto Select Textarea Text using javascipt?

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