源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

让textarea自动调整大小的js代码

  • 时间:2020-04-30 05:44 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:让textarea自动调整大小的js代码
[u]复制代码[/u] 代码如下:
<!doctype html> <html> <head> <title>自动调整大小的textarea </title> <meta charset = "utf-8" /> <style type = "text/css"> .editable{cursor:text; font-size:13px; color:#003366;width:80px;line-height:20px;height:20px;font-family:Arial;cursor:text;*overflow-y:hidden; } </style> </head> <body> <textarea class='editable' onkeydown ="if(event.keyCode==13) return false; " oninput="this.style.height='0px';this.style.height=(this.scrollHeight+'px');" onpropertychange="this.style.height=(this.scrollHeight+'px')" /></textarea> </body> </html>
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部