Web Programming  Home Web Programming JavaScript Select Textarea Content
rss

Select Textarea Content

Author: Codelifter More by this author


 
 
Click to Select
 
 

Put this code into your page:

<html>
<head>

<style>
.text
{
FONT: 10pt arial;
}
</style>

<script>
function selectText(){
document.TheForm.TheText.focus();
document.TheForm.TheText.select();
}
</script>

</head>

<body>
<br><br><br>
<center>
<TABLE width="150" border="0" cellpadding="0" cellspacing="0" bgcolor=#F5F4E0>
<tr>
<td colspan=3><img src=images/spacer.gif height=10></td>
</tr>
<tr>
<td><img src=images/spacer.gif width=10></td>
<td bgcolor=white>
<table border=0 cellpadding="0" cellspacing="3">
<tr>
<td valign="top" width=175>

<center><a href="javascript:selectText()" class=text>Click to Select</a></center>

<form NAME="TheForm">
<textarea rows="5" cols="20" NAME="TheText" wrap="on">
This is the text in the textarea. Change it to suit.
</textarea>
</form>

</td>
</tr>
</table>
</td>
<td><img src=images/spacer.gif width=10></td>
</tr>
<tr>
<td colspan=3><img src=images/spacer.gif height=10></td>
</tr>
</table>
</center>

</body>
</html>



Rate this Material: Bad 1 2 3 4 5 Excellent
print this page tell a friend subscribe to newsletter subscribe to rss

Add comments to "Select Textarea Content"