Home
Developer Blog
Ajax effects
CSS examples
Freelance jobs
Hot IT Jobs
Hot scripts
Code samples
Web hosting directory
Lotus Notes FAQ
See the new scripts recently added to Dynamic Drive.
Click here
.
Original, practical
CSS codes and examples
such as CSS menus for your site.
Search code samples
Keyword
All Categories
ASP
CSS
Dhtml
Html
Javascript
PHP
Code Samples
ASP
CSS
Dhtml
Html
Javascript
PHP
LOGIN HERE
Username
Password
Signup Now
Forgot Password
Verify Signup
Javascript >> Forms >> text/text area field
How do I select all the text in a text field/area?
Visitor Ratings (1) :
Description
the following code will select the text in the text field.
Code
Select All
<html> <script> function selecttext(){ var tf = document.testform.box1; tf.focus(); tf.select(); } </script> <body> <form name=testform> <input type= "text" name=box1 value= "some text"> <input type=button value= click onclick= selecttext()> </form> </body> </html>
Rate this Resource
0
1
2
3
4
5
6
7
8
9
10