»
EnglishFrenchVietnamese

Print - Select and Auto Copy - JavaScriptBank.com

Full version: jsB@nk » Form » Select and Auto Copy
URL: https://www.javascriptbank.com/select-and-auto-copy.html

Select and Auto Copy © JavaScriptBank.comWith this script you can highlight and copy text in a textarea box with the click of a button. IE only (In Netscape, it only highlights the text; it doesn't copy it.)

Full version: jsB@nk » Form » Select and Auto Copy
URL: https://www.javascriptbank.com/select-and-auto-copy.html



JavaScript
<SCRIPT LANGUAGE="JavaScript">// Russ ([email protected])<!-- Beginfunction copyit(theField) {var tempval=eval("document."+theField)tempval.focus()tempval.select()therange=tempval.createTextRange()therange.execCommand("Copy")}//  End --></script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<form name="it"><input onclick="copyit('it.select1')" type="button" value="Press to Copy the Text" name="cpy"><p><textarea name="select1" rows="3" cols="25">If this is highlighted, then it has been copied.</textarea></form><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->