/    Sign up×
Community /Pin to ProfileBookmark

Transfer Question

If I have a section of a web page specified within a unique id <div> tag,
is it possible to transfer the contents of the tag to a <textarea> box?

I’ve tried this, but without success within the <BODY> section:

[code=php]
<div id=”testdiv”>
Information displayed
within the &lt;div&gt; region.
</div>
<button
onClick=”document.getElementById(‘TArea’).value=document.getElementById(‘testdiv’).innerHTML”
Transfer Information</button>
<textarea id=”TArea” rows=”8″ cols=”50″></textarea>
[/code]

Thanks for any thoughts!.

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@gil_davisApr 20.2007 — I got this to work:&lt;div id="testdiv"&gt;
Information displayed
within the &amp;lt;div&amp;gt; region.
&lt;/div&gt;
&lt;form onsubmit="return false"&gt;
&lt;input type="button" onclick="document.getElementById('TArea').value=document.getElementById('testdiv').innerHTML" value="Transfer Information"&lt;/button&gt;&lt;br&gt;
&lt;textarea id="TArea" rows="8" cols="50"&gt;&lt;/textarea&gt;
&lt;/form&gt;
Copy linkTweet thisAlerts:
@JMRKERauthorApr 20.2007 — Thanks 'gil davis'

I got the original version to work ... after I REFRESHED THE STUPID PAGE!!!

My bad .. but I do appreciate the quick response and optional syntax.
Copy linkTweet thisAlerts:
@gil_davisApr 20.2007 — I got the original version to work ... after I REFRESHED THE STUPID PAGE!!![/QUOTE]The cache will get you most every time!?
×

Success!

Help @JMRKER spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.29,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...