我怎么会插在页面加载文本到文本区:插入文本到文本区域
<textarea name="orderNotes" cols="115" rows="3"></textarea>
我曾尝试:
var myTextarea = document.getElementsByClassName('orderNotes');
console.log(myTextarea);
myTextarea.value += "text to add to the textarea";
HTML:
<textarea name="orderNotes" cols="115" rows="3"></textarea>
–
属性'name'!='className' –
确保您的元素在页面加载之前执行代码之前先呈现 – massquote