Print textarea Box Into Web Page
The source code accompanying this article is available only to WebSite's Secret members.
A recent comment from a reader stimulated this article. The comment was, "How do I get the text out of the textarea box to use elsewhere?"
I'll show you how to transfer the content of a textarea box into a div on the same web page. The transfer can occur either:
• Immediately after any change is made to the text in the textarea box.
– or –
• When a button is clicked.
Both methods are explained. First, I'll demonstrate.
Copy textarea box into div - Demonstration 1
Between this paragraph and the textarea box below is a div. It will be updated with content of the textarea box whenever the content is changed, growing and shrinking as needed. (By my choice, the demo div is invisible so long as the textarea box has no content.)
The div containing the content typed into the textarea box can be anywhere on the page. It can be bordered or not, and either a specific size or allowed to grow and shrink like the demonstration.
Copy textarea box into div - Demonstration 2
Between this paragraph and the textarea box below is a div similar to the one in the first demonstration. It will be updated with content of the textarea box whenever the button is clicked.
The div containing the content typed into the textarea box can be anywhere on the page, with any style a div can have.
The source code is available only for WebSite's Secret members.
Will Bontrager