<html> <head> <script type="text/javascript"> function setfocus() { document.forms[0].txt.select() document.forms[0].txt.focus() } </script> </head> <body> <form> <input type="text" name="txt" size="30" value="Azhar World!"> <input type="button" value="Select text" onclick="setfocus()"> </form> </body> </html>
Edit the text above, and click on the button to see the result.
Copyright © 2007-2008, Www.JavaBasics.We.Bs All rights reserved.