【发布时间】:2013-05-24 01:04:07
【问题描述】:
一年前,我在寻找关于 autoresize textarea 的信息,我发现它here,当时这个脚本在 jsfiddle 中运行良好,但现在它不起作用,我在控制台浏览器上收到一条错误消息,如下所示:
Uncaught ReferenceError: autoresize is not defined
我尝试在我的计算机上将其设置为index.html,它可以工作。
我的问题,为什么它现在在 jsfiddle 中不起作用? 对不起,也许我的问题不是那么重要,我只是好奇,这是jsfiddle中的错误,还是脚本中的错误?
function autoresize(textarea) {
textarea.style.height = '24px';
textarea.style.height = textarea.scrollHeight + 12 + 'px';
}
【问题讨论】:
标签: javascript jsfiddle autoresize