日期:2014-05-16  浏览次数:20546 次

通过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