input 如何实现宽度随内容的增加而加宽 <INPUT TYPE="text" NAME="" onkeyup="this.value.length>5?this.style.width=200:''">思路 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 有个css式样可以控制的,具体的想不起来了! <script> var handleMax = function(obj){ obj.style.width = "6px"; var ch = obj.value; for(var i=0;i<ch.length;i++) { var n = ch.substr(i ,1); if(/^[\x00-\xff]/.test(n)) obj.style.width = (parseInt(obj.style.width.split("p")[0]) + 6) +"px" ; else obj.style.width = (parseInt(obj.style.width.split("p")[0]) + 12) +"px" ; } };</script><input type="text" onkeyup="handleMax(this)" style="width:20px" /> 多谢楼上的,那么我想实现当input超过一定宽度时让他自动增加一个input并在下一行显示怎么实现 用多行编辑器<textarea>不好?@_@ td { word-wrap:break-word;word-break:break-all;text-overflow:ellipsis;overflow:hidden } 可以去这个网站看看 www.wdfan.cn js问题,在线求解。 去除字符串中相同的字符 ajax回调后打开新窗口给ie拦截掉了 关于iframe的问题 验证IP合法性 谁见过<script src="scripts/test.js.zip>这种导入模式 有关jqgrid事件问题 求教一段严格控制输入日期函数的Js代码? 哪位大哥有javascript写的三级目录树的代码,小弟急需 在一个页面中如何屏蔽掉菜单栏?不是使用window.open()方法打开的,是通过链接打开的窗口, 如何实现根据用户的选择进行报名。。。急 如果禁用cookie时,如何保存已有的session_id
<script>
var handleMax = function(obj){
obj.style.width = "6px";
var ch = obj.value;
for(var i=0;i<ch.length;i++)
{
var n = ch.substr(i ,1);
if(/^[\x00-\xff]/.test(n))
obj.style.width = (parseInt(obj.style.width.split("p")[0]) + 6) +"px" ;
else
obj.style.width = (parseInt(obj.style.width.split("p")[0]) + 12) +"px" ;
}
};
</script>
<input type="text" onkeyup="handleMax(this)" style="width:20px" />