I am trying to fill a textarea
using javascript, the thing is i found out that textarea
doesn't have the value tag, and <textarea ..></textarea>
is not an option since i cant use it with javascript.
Edit :
content.document.getElementsByName("cr-work-desc0").innerHTML = "125645";
content.document.getElementsByName("cr-work-urls0").textContent = "this is some sample text";
content.document.getElementsByName("infringing-urls0")[0].setAttribute("value","testing to");
The HTML <textarea> autocomplete Attribute is used to specify whether the Textarea field has autocomplete on or off. When the autocomplete attribute is set to on, the browser will automatically complete the values based on which the user entered before.
From the MDN documentation: " <textarea> does not support the value attribute".
Use the <textarea> tag to show a text area. The HTML <textarea> tag is used within a form to declare a textarea element - a control that allows the user to input text over multiple rows.
You cannot place HTML elements inside a text area, only text content. only text content covers that part.
Try following code
document.getElementById("aa").innerHTML="Blah Blah";
<textarea id="aa"></textarea>
Both innerHTML and value works fine.
You can write anything in place of aaaa
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With