How can I set the CSS-class in javascript for a DIV-element?
<div id="myId">
<!-- -->
</div>
document.getElementById("myId").className = "someClass";
Using jQuery:
$("#myId").attr("class", "someClass");
Using JQuery
$("#myId").attr("class", "cssClass");
If you are using jQuery, use the native addClass() method, which is easier to read and purpose built for this exact question
$('#myId').addClass('foo');