<textarea id="test" style="height:30px"></textArea><input type="button" value="+" onclick="document.all.test.style.height=document.all.test.style.height.replace('px','')/1+10">
<input type="button" value="-" onclick="document.all.test.style.height=document.all.test.style.height.replace('px','')/1-10">

解决方案 »

  1.   

    <script language="javascript">
    function chgSize(flag)
    {
    var obj = document.all.mytextarea
    var col=5;//设置每次列改变量
    var row=1;//设置每次行改变量
    if(flag>0)
    {
    obj.cols+=col;
    obj.rows+=row;
    }
    else
    {
    if(obj.cols>col)
    obj.cols-=col;
    if(obj.rows>row)
    obj.rows-=row;
    }
    }
    </script><input type="button" name="button" value="+" onclick="chgSize(1)"/>
    <input type="button" name="button" value="-" onclick="chgSize(-1)"/>
    <br />
    <textarea name="mytextarea" cols="50" rows="5"></textarea>
      

  2.   

    <SCRIPT>
    function call_me(max_length) {
    if((document.form1.mybox.value == null ) || (document.form1.mybox.value == "" )) document.form1.mybox.size = size;
    if((document.form1.mybox.value.length >= size)&&(document.form1.mybox.value.length <= max_length)) document.form1.mybox.size = document.form1.mybox.value.length + 1;
    else document.form1.mybox.size = size;
    }
    </SCRIPT><FORM name=form1>
    <DIV align=center><INPUT style="FONT-FAMILY: Terminal" onfocus="setInterval('call_me(document.form1.mybox.maxLength)', 1)" maxLength=30 size=10 name=mybox> </DIV></FORM>
    <SCRIPT>
    var size = document.form1.mybox.size; 
    </SCRIPT>
      

  3.   

    动态改变多行文本框
    <TEXTAREA class=InputArea1 id=id style="OVERFLOW-Y: hidden; WIDTH: 100%; HEIGHT: 114px" onpropertychange=this.style.posHeight=this.scrollHeight name=bz rows=4>
    </TEXTAREA>