当前位置: 代码迷 >> HTML/CSS >> 透过js增加style中某个样式的值
  详细解决方案

透过js增加style中某个样式的值

热度:395   发布时间:2013-10-30 12:56:22.0
通过js增加style中某个样式的值
<form name='form1'>
<select name="select1" MULTIPLE style="width:120;height:140"></select>
<input type="button" value="增高" onClick="document.form1.select1.style.height+=4+'px';">
</form>

点击增高按钮后,想实现select1的高度增加4px,但实际上点击后select的高度没有发生变化,请教大家如何写?谢谢!

------解决方案--------------------
document.form1.select1.style.height+=parseInt(document.form1.select1.style.height)+4
  相关解决方案