textarea js赋值问题,为什么 value 和 innerHTML 都不行??
function getMessage()
{
aContent.length = 0;
var aTextarea = document.getElementsByTagName('textarea');
for (var i = 0; i < aTextarea.length; i++) {
aContent.push(aTextarea[i].value);
};
//console.log(aContent)
}
function setMessage()
{
var aTextarea = document.getElementsByTagName('textarea');
for (var i = 0; i < aContent.length; i++) {
console.log(aContent[i]);
aTextarea[i].innerHTML = aContent[i];
aTextarea[i].value = aContent[i];
};
}
web web前端开发 HTML w3c JavaScript
飞翔的寂寞
10 years, 1 month ago