Wow ... I did not really know that <textarea> is such a weirdo
These tests have been performed using FF5
Test 1
Code:
<textarea id="mytext" value="My value text"></textarea>
This will show an empty(!) textarea
Test 2
Code:
<textarea id="mytext" value="My value text">My innerHTML text</textarea>
var myValue = document.getElementById('mytext').value;
var myInnerHTML = document.getElementById('mytext').innerHTML;
This will show a textarea with the text "My innerHTML text". Both variables will have this value, too.
Bottom line 1: A textarea will only show the text in the innerHTML area initially. The value attribute is being ignored
Test 3
Code:
document.getElementById('mytext').value = "My new value";
document.getElementById('mytext').innerHTML = "My new innerHTML";
var myNewValue = document.getElementById('mytext').value;
var myNewInnerHTML = document.getElementById('mytext').innerHTML;
This will change the content of the visible textarea to "My new value" (!). But the two variables in the end will have different content. But only the .value is relevant for the textarea.
Bottom line 2: To programmatically change the content of a textarea you'll have to set the .value property
Final result: To initially set the content of a textarea via HTML, you need to provide innerHTML. But to change or read the content afterwards, you'll have to use the .value property only. innerHTML will give you the current innerHTML at any given time but it will not always correspond to the visible textarea content!