473,543 Members | 2,446 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

innerHTML vs value for TEXTAREA element

Hi :)

i just discovered (in gecko-based browsers) that if i dynamically
create a TEXTAREA and assign a string to its innerHTML, all works
fine (my string is displayed inside the TEXTAREA once it's
attached to some suitable place in the DOM tree); BUT if i
grab an existing TEXTAREA t and replace t.innerHTML, nothing
changes until i do the same replacement on t.value. is that a
bug, or that's the way it's supposed to be?

/dr.bob

Jul 23 '05 #1
1 12817
On 27/05/2005 12:30, dr.bob wrote:
i just discovered (in gecko-based browsers) that if i dynamically
create a TEXTAREA and assign a string to its innerHTML


You should really stop right there. TEXTAREA elements can only contain
text and the expected way of accessing or modifying that data is via the
value property.

The fact that it implements the innerHTML property at all is
conceptually odd, and probably best forgotten.

An explanation for the behaviour you're seeing? I can't give you one,
but it seems reasonable to assume a relationship to the above.

[snip]

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
8435
by: Phil N | last post by:
Hello again Site I'm working on: http://www3.telus.net/bikim/lightning/test/ - 'coach' & 'main' links swap innerHTML of div element - id 'textArea' works fine in NN7; IE6 reports 'Object doesn't support this property or method' code is:
2
3545
by: Martin Turner | last post by:
Can anyone tell me why the following bit of code doesn't work in Netscape (6) but does in IE6 ? It is just an example which is supposed to toggle some text in both the <textarea> and <p> elements but what happens in Netscape is that the <textarea> seems to get overwritten rather than written to whereas the <p> element is just written to or...
4
11182
by: dekern | last post by:
I have been trying to set the default text value of a TextArea element for about a day now without any luck. Similar to the code used to set the Text field below I would like to use the returned (for lack of a better term) value in a TextArea element ie. {TITLE}. this works: <input readonly="true" value="{TITLE}" name="titleedit"...
4
2615
by: Nick | last post by:
OK. I've had a trawl through past messages but can see nothing that helps me, so...here goes... I am writing a web application which, among other things, pushes a web page to a user's browser. In very simple terms: - I have a script in hidden frame A which sets the document.location of main frame B.
3
5276
by: soup_or_power | last post by:
Hi Sorry about the heading. I have a table with td consisting of lists with <select></select>. When I do a document.getElementById("element").innerHTML I don't see the selected item. IOW, the innerHTML is not dynamic. Is there some way to get the most recent selected without traversing through the list's options. Thank you
8
8406
by: McKirahan | last post by:
Firefox does not reflect selected option via innerHTML How do I get Firefox to reflect selected option values? <html> <head> <title>FFinner.htm</title> <script type="text/javascript"> function clicks() { document.getElementById("t1").value =
10
12620
by: Jake Barnes | last post by:
This weekend I wanted to learn AJAX, so I set up a little toy page where I could experiment. The idea of this page is that you click in one of the boxes to get some controls, at which point you can add text, images, or HTML to the box. This seems to work fine in FireFox, but not in IE. You can see the problem here: ...
2
19564
by: xhe | last post by:
I met a very headache problem in javascript, I think this might be difference between IE and NS / Safari. I have a text area <form> <textarea name='tex1' onkeyup='displayit();'></textarea> </form> <span id="txtValue"></span> <script language='javascript'>
4
1530
by: theaj | last post by:
Hi all, im trying to change the CSS of an HTML element dynamically...for that purpose im taking help of innerHTML property. i have made the text on which CSS gets applied dynamically, editable, with the help of textarea. the problem im facing is, maybe mozilla remembers the innerHTML of a textarea on the first posting. So if the user edits...
0
7402
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7347
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
5883
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5264
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4890
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3388
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3391
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1814
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
633
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.