Input文本框随着输入内容多少自动延伸有-bug
2016-10-24 10:12
330 查看
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> <script language="javascript"> function checkLength(which) { var oTextCount = document.getElementById("char"); iCount = which.value.replace(/[^\u0000-\u00ff]/g,"aa"); oTextCount.innerHTML = "<font color=#FF0000>"+ iCount.length+"</font>"; which.style.border = '1px dotted #FF0000'; which.size=iCount.length+2; } </script> <style type="text/css"> .lkbnrcdvarea { max-width: 211px; min-width: 211px; height: 38px; border: 1px solid #000; overflow-y: hidden; *max-width: 201px; *min-width: 201px; } </style> </head> <body> <input name="words" size="2" onkeyup="checkLength(this)"/> <span id="char">0</span>个字符 <textarea name="" id="" cols="30" rows="10" onpropertychange="this.style.height = this.scrollHeight + 'px';" oninput="this.style.height = this.scrollHeight + 'px';" class="lkbnrcdvarea"></textarea> <textarea name="textarea" id="textarea" style='overflow-y: hidden;height:20px' onpropertychange="this.style.height = this.scrollHeight + 'px';" oninput="this.style.height = this.scrollHeight + 'px';"></textarea> </body> </html>
删除时输入的字时出现问题
相关文章推荐
- Input文本框随着输入内容多少自动延伸
- Input文本框随着输入内容多少自动延伸
- Input文本框随着输入内容多少自动延伸
- Input文本框随着输入内容多少自动延伸
- Input文本框随着输入内容多少自动延伸
- Input文本框随着输入内容多少自动延伸的实现
- Jquery实现 TextArea 文本框根据输入内容自动适应高度
- Asp.net中多行TextBox随着输入的函数多少自动改变
- [ExtJs4.0]根据一个文本框输入的内容自动填写到另外一个文本框内
- Jquery 文本框输入内容,自动匹配select 下拉框内容
- 输入内容自动完成文本框(AutoCompleteTextView )
- JS实现在文本框输入时自动弹出相关内容提示
- inputSuggest文本框输入时提示、自动完成效果(邮箱输入自动补全插件)
- Tag It 一款 Jquery控件,当你在文本框中输入逗号时,自动帮你分隔开相关内容
- 让容器高度随着内容多少自动大小(兼容IE火狐)
- input文本框输入内容时实时显示在别的盒子。
- 输入内容自动完成文本框(AutoCompleteTextView)
- 禁用文本框输入时的自动提示原来已输入过的内容
- 文本框输入内容时,里面的提示信息自动消失 css
- div可以输入内容不用input作为输入框屏蔽自动的input样式