复制代码 代码如下: <!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>
推荐阅读
再次分享18个非常棒的jQuery表格插件
1.DataTables
在线例子2.tablesorter
在线例子3.uiTableFilter
在线例子4.columnHover
在线例子5.Scrollable HTML
在线例子6.columnManager
在线例子7.Flexigrid
在线例子8.Table Drag and Drop
在线例子9.Hea>>>详细阅读
本文标题:让textarea自动调整大小的js代码
地址:http://www.17bianji.com/kaifa2/JS/24703.html
1/2 1