js select all

JavaScript
// This will select all of the text in the textarea or input called element
element.select();
Source

Also in JavaScript: