- JavaScript - Forms
·Document Info
·Script Writers
·What's New?
Mail List


Select All Text
The Textarea (<textarea> </textarea>) is a great way to get larger amounts of text input into your applications, but it can also be used to segment text that you’d like to make available for people to copy to the clipboard. The more text you make available the more difficult it will be for you to present and for your users to highlight and copy. Fortunately you can replicate the Edit -> Select All actions to allow all your text to be highlighted. The following example contains the opening to the Gettysburg address. All the text will be highlighted when the input button is clicked.
View the Output
Text View
Print View
Mail this Link
Download the Code

<title> (JavaScript: Select All)</title>
<body bgcolor="#FFFFFF">

<form name="select_all">

<textarea name="text_area" rows="10" cols="80">
Four score and seven years ago our fathers brought forth on this 
continent a new nation, conceived in liberty and dedicated to the 
proposition that all men are created equal. Now we are engaged in 
a great civil war, testing whether that nation or any nation so 
conceived and so dedicated can long endure. 

<input type="button" value="Highlight Text" onClick="javascript:this.form.text_area.focus();;">






ASP: What's New? | Articles | Script Writers | Database Display | Read/Write
Server Variables | Response Objects | Random Events | Miscellaneous
HTML: Forms | Hyperlinks | Headers | Tables | Hyperlinks | Headers | Text Display
JavaScript: Document Info | Forms | Images | Navigation | Script Writers
CSS: Basics | Page Display | Text Display | Script Writers | Miscellaneous
Maps: Map Script Writers | Bing Maps | Google Maps
Privacy Statement is hosted by
Donate Food Online with a Mouse Click at
Donate Land Online with a Mouse Click at
© 1999 - 2014
All Rights Reserved