当前位置: 首页 > Web前端 > HTML

前端页面:一直报Cannotsetproperty'height'ofundefined

时间:2023-04-02 19:35:19 HTML

1.一个错误的例子,只复制了项目中的一些关键问题。例子中明明写着属性style='height:16px',为什么还是说heightisundefined?我通过打印发现:cks.each(function(){autoTextAreaHeight($(this));});把里面的$(this)取出来做数组处理,所以[0]菜鸟教程(runoob.com)更改为cks.each(function(){autoTextAreaHeight($(this)[0]);})

最新推荐
猜你喜欢