How to Select all Text in a Input Box with One Click

Use OnClick to Select all text in a textbox to copy and paste fast. Useful for developers that need sharable links.

This is a code snippet to select all text in a textbox with javascript. 

<input onClick=";" value="Sample Text" />


<input onClick="this.setSelectionRange(0, this.value.length)" value="Sample Text" />