CodeAve.com CodeAve.com - JavaScript - Forms
ASP
JavaScript
·Document Info
·Forms
·Images
·Miscellaneous
·Navigation
·Script Writers
·Contents
·What's New?
CSS
HTML
Maps
Links
Mail List
Search
Sitemap


 


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

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

<center>
<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. 
</textarea>

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

</form>
</center>

</body>
</html>

 

 

 



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

CodeAve.com is hosted by MyHosting.com
Donate Food Online with a Mouse Click at TheHungerSite.com
Donate Land Online with a Mouse Click at TheRainForestSite.com
© 1999 - 2014 CodeAve.com
All Rights Reserved