<!Doctype HTML PUBLIC "-//W3c//DTD Html 1.0 Transitional//EN">
<html>
<head>
<title>文本框宽度自动适应文本宽度 </title>
</head>
<script type="text/javascript">
function changeInputlength(cursor)
{
var getText=document.getElementById("text");
cursor.size=getText.value.length+2;
}
</script>
<body>
请输入字符:<input type="text" size="3" id="text" onkeydown="changeInputlength(this);"/>
</body>
</html>
详细解决方案
js统制文本框自动适应文本长度
热度:176 发布时间:2013-10-16 11:29:46.0
相关解决方案