<!DOCTYPE html>
<html>
<body>
Name: <input type="text" id="inputbox" value="HONGTTING">
<button type="button" onclick="myFunction()">Try it</button>
<script>
function myFunction() {
document.getElementById("inputbox").select();
}
</script>
</body>
</html>