<span style='cursor:hand' title='缩短对话框' onClick='if (me.size>10)me.size=me.size-2'>-</span>
<input name="txttitle" id=me type="TEXT" size=30 maxlength=100 style="background-color:ffffff;color:000000;border: 1 double">
<span style='cursor:hand' title='加长对话框' onClick='if (me.size<102)me.size=me.size+2'>+</span>
<input name="txttitle" id=me type="TEXT" size=30 maxlength=100 style="background-color:ffffff;color:000000;border: 1 double">
<span style='cursor:hand' title='加长对话框' onClick='if (me.size<102)me.size=me.size+2'>+</span>
看这个:
<input onkeydown="this.size=(this.value.length+1)">不过仍有缺陷:中文不行,块头太大 :-)
那就先判断以下this.value的值好了,是汉字的this.size=this.value.length+2,否则this.size.this.value.length+1
<table><td nowrap id=demo style=visibility:hidden;font-size:11pt></td></table>
<input style='width:expression((this.value.length+((arr=this.value.match(/\W/g))?arr.length:1))*6.5)'>再高一点就是
<input style="overflow-x:visible">