Javascript Copy Selected Text Box Select All Highlight Text Form Copy Paste
here is a demo:
here is the code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Select Copy Text Into Clipboard History with Javascript</title>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function copyit(theField) {
var selectedText = document.selection;
if (selectedText.type == 'Text') {
var newRange = selectedText.createRange();
theField.focus();
theField.value = newRange.text;
} else {
alert('Alert: Select The text in the textarea then click on this button');
}
}
// End -->
</script>
</head>
<body>
<p><strong>Select Copy Text Into Clipboard History with Javascript by Wallpaperama.com </strong></p>
<p><strong>Steps:</strong></p>
<p><strong>1. Hight the text inside the text area below</strong></p>
<p><strong>2. Click on the form button, this will copy the text into your clipboard (basically the same as hitting control + c on your keyboard)</strong></p>
<form name="javascript">
<input onclick="copyit(this.form.text_select)" type="button" value="Click Here to Copy the Highlighted Text" name="copy_button">
<p>
<textarea name="text_select" cols="35" rows="5" wrap="VIRTUAL">FREE WALLPAPERS An Amazing collection of High quality, high resolution wallpapers for your computer desktop for free. Download your favorite high resolution wallpaper for free at wallpaperama.com. Our free wallpapers include a large collection of wallpapers for your computer desktop. You will find only free wallpapers, no pop-up ads, no spam, no spyware only high quality free wallpapers for your computer background. Surf with confidence.
</textarea>
</form>
<div align="center">
<p align="left">If you learned or liked this script, we would appriciate puting a link of <a href="http://www.wallpaperama.com">wallpaperama.com</a> on your site. If you would like to exchange links with us, please <a href="http://www.wallpaperama.com/exchange-links.php">click here</a> to exchange links </p>
<p>Hosting By <a href="webune.com">Webune.com</a> </p>
</div>
</body>
</html>
Try it on your website, you will like it
here is another way to select the content in a field with javascript: check it out
javascript select all text form button
NOTE: This will work on Internet Explorer. I tried it on Mozilla Firefox but i did not do anything. i was hoping someone can help me with firefox?
Please go for another script...................
This is another way for highlight html page contents , we will use the power of JQuery. It works on IE,Opera,FireFox & Safari Browsers.
Please read the Article Here:
sevenadoo.c
<a href=" 6raphic.blogspot ">genial</a>
<a href=" logiclabz /javascript/copy-to-clipboard-with- to clipboard javascript firefox ie</a>
i want to apply bold to the selected part of text in a textbox control.
is it possible? if so plz help me in coding.
Related Content
Information
Javascipt Forums And Other Related Topics Discussion About Javascript Progamming »
Javascript Copy Selected Text Box Select All Highlight Text Form Copy Paste
Date: Thu Jan 11, 2007
Author braker Received 21 Replies #789
Share



copyright © 2013 wallpaperama - All Rights Reserved - Last Updated Mon May 06, 2013 (-8 GMT)
Powered by: Webune Forums V5