hey there i want to change some css attributes from javascript
but i cant access css values for that div
here is what i have in my css file
#sidebar {
float: left;
width: 160px;
padding: 25px 10px 0 20px;
}
#sidebar ul {
margin: 0;
padding: 0;
list-style: none;
}
here is my html code for that div
<div id="sidebar">
<%@ include file="some_page.jsp" %>
</div>
here is my javascript code on some click event
var element = document.getElementById('sidebar');
alert(element.style.length); //Will alert 0
alert(element.style.width);//Empty alert box
i want to change the width attribute , can u help me please ?
thank you