We would like to know how to highlight the text in the input text box.
<html>
<head>
<script language="JavaScript">
function selectText(){<!--from w w w .j a va 2 s . c o m-->
document.myForm.myText.select();
document.myForm.myText.focus();
}
</script>
</head>
<body>
<form name="myForm">
<input type=TEXT value="hello world" name="myText">
<input type=BUTTON value="Click to Select Text" name="myButton" onClick="selectText()">
</form>
</body>
</html>
The code above is rendered as follows: