I use .innerHTML
to add text in textarea
. But If I starting edit text in textarea
by myself script stops working.
Here it is:
(function($){
addPort = function(name) {
switch(name) {
case 'name1':
var code = "text1";
break
case 'name2':
var code = "text2";
break
case 'name3':
var code = "text3";
break
default:
break
}
document.getElementById("codeArea").innerHTML += code;
}; })(jQuery);
Don't pay attention on jQuery. Some other function use it.
Here's the textarea
:
<textarea id="codeArea" name="codeAreaPost"></textarea>
Thanks.
its just replace innerHTML
by value property
document.getElementById("codeArea").value
not innerHTML
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