<input type="button" name="SubmitS" value=" 查看更多 " class="adminbutton" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#b79855' " style="height:30px;padding-top:1px; width: 150" >
其中onMouseOver="this.style.backgroundColor='#b79855' " 只是改变了经过的背景色.如果想同时改变字体颜色应该怎么写?
试试:
onMouseOver = function(){意思是onMouseOver=""不能直接改两个属性? 一定需要另写一个function?
追答可以直接两个一起写,用分号隔开。如:
onMouseOver="this.style.backgroundColor='#b79855'; this.style.color = 'red';"