HomePHP, HTML, CSS ScriptsTutorialsRequest HelpAbout UsContact Us
Cambridge, Peterborough Web Design
Stay informed - Newsletter Signup
 Script Javascript Select All Textfield, Textarea

Dated Added: 11th October 2007

This script highlights all text within a textarea or textfield when selecting.

You simply add the javascript area to your file then add the onclick command to your textfield or textarea.

We use this exact code on this page

See below for more information
<script type="text/javascript">
function SelectAll(id)
{
document.getElementById(id).focus();
document.getElementById(id).select();
}
</script>

<textarea name="textarea" cols="40" rows="5" onClick="SelectAll('textarea');" id="textarea">This is a textarea</textarea>

<input name="textfield" type="text" id="textfield" onClick="SelectAll('textfield');" value="This is a textfield" />
Script Updates
Ajax
ASP
ASP.NET
CSS
HTML
Java
Javascript
PHP
Python
Ruby on Rails
Useful Tools
XML
Request Help
Request a Script
Request WebDev
Contact Us
About Us


Ajax Scripts | ASP Scripts | ASP.NET Scripts | HTML Scripts | Javascript Scripts | PHP Scripts | Python Scripts | Ruby on Rails Scripts | XML Scripts
2001-2007 © All Rights Reserved. 3Branch Internet Development. All content is available under the GPL