<input type="text" style="width:100;height:30" name="t"><P>
高<input type="text" size="10" onBlur="t.style.height=this.value"><P>
宽<input type="text" size="10" onBlur="t.style.width=this.value"><P>不同的控件有不同的属性

解决方案 »

  1.   

    style属性是指样式表,使用时可以如下:
    <input type="text" style="border:inset 0;background-color:blue">
    我建议你,有时间看看css样式表,会有收获的
      

  2.   

    style是元素的一个对象,其中包含了用户对该元素自定义的样式的集合.<button onclick="alert('border:' + this.style['border'] + '\ncolor:' + this.style.color + '\nbackground-color:' + this.style['backgroundColor'])" style="border:1 red solid;color:blue;background-color:#cccccc">按钮的一些样式</button>样式表说明手册
    http://www.rainersu.com/download/css20.chm
    谢谢RainerSu翻译制作的这本让很多人得益的说明
      

  3.   

    注意针对不同的浏览器有不同的调用:
    IE:
    obj.style.styleproperty
    网景:
    obj.styleproperty