Copy to Page | JavaScriptSource

Copy to Page

JavaScriptSource Staff Jul 6, 2007


This snippet will copy text entered into a form field and place it directly on the Web page.

Input text here:

When you tab out or click somewhere else on the page, your text will appear below.

Your input:


Source Code

Paste this source code into the designated areas.

External file

Paste this code into an external JavaScript file named: copyToPage.js


Paste this code into the HEAD section of your HTML document.


Paste this code into the BODY section of your HTML document

Leave a Response


This code produces an "Object Expected" error. Both on "this" page and on my test page. Same problem in IE and Chrome. Does a variable need to be declared somewhere?

Keith Apr 29, 2014

it's work but little change, thanks bro for script code

Emir Apr 7, 2009

You could just place it in the head, between script tags or place it in an external filed named "copyToPage.js"

Lee Oct 3, 2007

Hi All,[br /]This script would help me out alot, but I can't figure out what i'm doing wrong. Placed the appropriate code in the Head and Body... not sure where to put the External Code. New to javascript, any suggestions. thanks

steve Sep 14, 2007

I have no knowledge of Javascript, but found this code useful for my purpose. However, I'm trying to have the same text input appear several times in different parts of the same form. I don't really know how to adapt this code to achieve that. Help appreciated.[br /][br /]Thanks

Chris Aug 12, 2007