在文本区域元素上使用onload [英] use onload on text area element
问题描述
我想在 textarea
元素上使用onload.
试图弄清楚我在做什么错
I want to use onload on a textarea
element.
Trying to figure out what am i doing wrong
< textarea id ="textarea_info" onload ="resizeFunction()"></textarea>
现在只是要检查它是否可以在javascript中工作,我正在使用警报:我试过了:
now just to check if it works in javascript i'm using alert: i've tried:
document.getElementById("textarea_info").onload = function(){
alert("lop");
};
还有:
function resizeFunction(){
alert("lop");
}
我已经尝试过onload和onLoad,但是该警报从未通过...js文件已正确包含
i've tried onload and onLoad but that alert never got through... the js file is included correctly
推荐答案
文本区域没有此类事件加载.
在此处了解有关方法,属性和事件的更多信息.
There is no such event onload for text area.
Read more about it here, about the methods, properties and events.
我假设您是想第一次使用它初始化.
为此,只需立即执行您想要的操作即可.
I assumed you want to init it with something for the first time.
For this simply do what ever you want straight away.
document.getElementById("textarea_info").WHATEVER_I_WANT_TO_DO
这篇关于在文本区域元素上使用onload的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!