|
HTML DOM select() Method
Complete Text Object Reference
Definition and Usage
The select() method is used to select the content of a text field.
Syntax
Example
The following example selects the content of a text field:
<html>
<head>
<script type="text/javascript">
function selText()
{
document.getElementById("myText").select()
}
</script>
</head>
<body>
<form>
<input size="25" type="text" id="myText"
value="A cat played with a ball">
<input type="button" value="Select text" onclick="selText()">
</form>
</body>
</html>
|
|
Complete Text Object Reference
|