Javascript object.select() can bse used to select full text in textarea and text put fields in HTML.
Example – select all in textarea
<textarea id=id1>Text inside textarea</textarea><br> <button type="button" onclick="selectAll()">SelectAll</button> <script type="text/javascript"> function selectAll() { var obj = document.getElementById("id1"); obj.select(); } </script>
Example – select all in text input
<input type=text id=id1 value="Text inside text input"><br> <button type="button" onclick="selectAll()">SelectAll</button> <script type="text/javascript"> function selectAll() { var obj = document.getElementById("id1"); obj.select(); } </script>