SitePoint Sponsor |
|
User Tag List
Results 1 to 5 of 5
Thread: accessing text in textarea
-
Jun 14, 2007, 13:27 #1
- Join Date
- Oct 2005
- Location
- London
- Posts
- 1,678
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
accessing text in textarea
hi, im trying to access text in a textarea via the DOM. the textarea id is area Ive tried:
Code JavaScript:var myvar = document.getElementById("area"); var area_text = myvar.TextNode;
Thanks
-
Jun 14, 2007, 14:06 #2
- Join Date
- Jan 2007
- Location
- Belgium
- Posts
- 591
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Just use textarea.value...
Code JavaScript:var myvar = document.getElementById("area"); var area_text = myvar.value;
FOR SALE: 1 set of morals, never used, will sell cheap
-
Jun 14, 2007, 14:28 #3
- Join Date
- Oct 2005
- Location
- London
- Posts
- 1,678
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
ahh....i see. Thanks hexburner
-
Jun 14, 2007, 15:33 #4
- Join Date
- Jan 2005
- Location
- Too far up north
- Posts
- 1,566
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I am just curious, where did you get TextNode from? A simple google search would have give you what you looked for.
-
Jun 15, 2007, 00:12 #5
- Join Date
- Oct 2005
- Location
- London
- Posts
- 1,678
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hi,
Yeah you're probably right and i did do a search for "accessing text in a textarea javascript" but it gave me links on how to access selected text in a textarea...so i just posted....maybe i shoulda looked harder
Anyways it doesnt work in this instance as its part of a ajax function. The ajax loads text in to a textarea for editing. I need a way to get at the edited version of the text and get it in to a javascript variable. At present all it does it get the version that was originally loaded in to the textarea before editing......
Any ideas how to do that?
Bookmarks