Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: Textbox selection


Message #1 by andy@a... on Tue, 20 Feb 2001 11:28:20
Use the select method, ie

<html>
	<input name="txtBox" value="Hello, World!">
</html>
<script>
	txtBox.select()
</script>

-----Original Message-----
From: andy@a... [mailto:andy@a...]
Sent: Tuesday, February 20, 2001 6:28 AM
To: javascript
Subject: [javascript] Textbox selection


Hi

How can I automatically select all the text in a text box if the user 
moves into it with a mouse click. What I want is the same effect that 
occurs if the user tabs there.

Thanks

Andy Green

  Return to Index