put variable in a textarea
im trying to merge two demo page whos finaly get latitude and longitude from googlemap and make it appear in a textarea to make it available to copy to clipboard by a button.
this is my test page
http://www.ma117.info/getadd4.html working with i.e. only
im able to display latlng in
but i need to make it appear in a textarea to be catch by clip variable
<td align="left"><textarea id="fe_text" cols=50 rows=5 ="clip.setText(this.value)">text here</textarea></td>
but the error is undefined or OBJECT
thanks to help me to understand
now i know the diferrence between .value and .innerhtml
and it wok with innerhtml
Form's elements (like TEXTAREA) have a value. Other non-empty elements (like DIV) have either the innerHTML property (which is not quite standard, but it will work in most all of the cases) either childNodes,which can be of different types (textNodes, other tags, etc). If a non-empty tag accepts a text node as a firstChild, and only as a firstChild (no other childs nested), that text node is also to be read/written using various methods, like nodeValue (property of the textNode), text (property of the parentNode), textContent (property of the parentNode), data (property of the textNode) ...
Last edited by Kor; 10-19-2011 at 08:45 AM.
element.innerHTML and element.children are standard methods in all current browsers, as mandated by the HTML5 spec, which although unfinished, has already been largely implemented...
.children is like .childNodes, but with just the sub-elements; no messy text nodes or comments to deal with in elm.children.
Create, Share, and Debug HTML pages and snippets with a cool new web app I helped create: pagedemos.com
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread