Skip to content Skip to sidebar Skip to footer

.innerhtml Doesn't Work Properly (i Guess)

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(na

Solution 1:

its just replace innerHTML by value property

document.getElementById("codeArea").value

not innerHTML

Solution 2:

innerHTML will parse the value as HTML and make the resulting DOM a child of your text area. This is not what you want. Try the value attribute instead:

document.getElementById("codeArea").value += code;

Post a Comment for ".innerhtml Doesn't Work Properly (i Guess)"