Not a Member Yet,
Click here to Register

ID: 82
Viewed: 2953
Added: Feb 14, 2002
Version:
Snippet uploaded by: snippet
Written By: snippet
Demo: Sorry, no demo



User Rated at: 0 Stars
Rate This:

Thank you for your vote. Please wait...

It appears you already voted for this snippet

It appears your vote value was empty

This little code will highlight all the words in a textarea or input box so you have the ability to copy what you selected. This will work as a link instead of a button. but it doesn't matter what you use.

Check the form name and the textarea name are the same as the function you have in the head tags.

form1 = form name
box = textarea name

Browsers: All

e.g. this page uses this script.

<!---Head--->
<script LANGUAGE="JavaScript">
// text selector

function selectCode(){
document.form1.box.focus();
document.form1.box.select();
}
</script>

<!---Body--->


 <a href="javascript:selectCode()">Highlight All</a>

<form name="form1">
<textarea name="box">your stuff here</textarea>
</form>


No Comments to show

Please completely fill out the form below if you want to review this snippet. All reviews are subject to validation.


Replying to a Comment...


Adding your comment. Please wait...

Thanks for adding your comment!. After further review it will be added.

There was a problem adding your comment. Please try again.

Please complete all the fields in the form before sending.

© 2002 - 2024 snippetlibrary.com All Rights Reserved. Conditions
Do NOT follow this link or you will be banned from the site!