手机
当前位置:查字典教程网 >编程开发 >Javascript教程 >让textarea自动调整大小的js代码
让textarea自动调整大小的js代码
摘要:复制代码代码如下:自动调整大小的textarea.editable{cursor:text;font-size:13px;color:#00...

复制代码 代码如下:

<!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 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>

【让textarea自动调整大小的js代码】相关文章:

7个有用的jQuery代码片段分享

Ctrl + Enter提交前检测的代码

超酷右下浮出广告窗口代码

解析Node.js基于模块和包的代码部署方式

让焦点自动跳转

对textarea框的代码调试,而且功能上使用非常方便,酷

一段实时更新的时间代码

textarea是否自动换行

将HTML自动转为JS代码

光标定位等TextRange的操作的范例代码

精品推荐
分类导航