Change .css file from javascript
I have this in a CSS file:
#tabs .bg {
backgroun开发者_如何学编程d: url("../images/bg-tabs-r.gif") no-repeat scroll 100% 0 transparent;
height: 39px;
line-height: 42px;
overflow: hidden;
width: 100%;
}
Through JavaScript how do I change background
to blank color and line-height
to 28px
.
If you use jQuery (you should) it's very easy:
$('#tabs .bg').css({'background': 'none', 'line-height': '28px'});
Use it directly on your element:
mytab=document.getElementById("tabs");
mytab.style.background="white";
mytab.lineHeight="28px";
精彩评论