The contents of textarea tag is stored in the value attribute, not the innerHTML, as many seem to think. textcontent (which should be spelled textContent) changes innerHTML, not value.
On Tuesday, March 4, 2014 4:12:24 PM UTC-5, An Mertens wrote:
-- Use:
code.value = "test";
On Tuesday, March 4, 2014 4:12:24 PM UTC-5, An Mertens wrote:
A javascript application puts a message in a textarea of an html page. After the message has been put in the textarea, the message immediately disapears.code in javascript application:xhr.onreadystatechange=function(){ if (4===xhr.readystate){var code = document.querySelector("textarea") code.textcontent="test"}}xhr.send()code in the html file:<textarea name="textarea" id="textarea" width="1000" style="width:1000px" autocomplete="on"></textarea>Output in the textareatestBut the text "test" immediately disappears.
You received this message because you are subscribed to the Google Groups "JavaScript Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to javascript-information+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.