or you can just change the class using the id.
Place it right after the div you want to change, and it will change right when it's done loading.
Code:
<div class="someoldclass" id="myDiv">
Lorem ipsum dolor sit amet.
</div>
<script>
document.getElementById("myDiv").className = "mycoolnewclass";
</script>
or you could use it a a function in the header and then trigger it however you want.
Code:
<head>
<title>whatever...</title>
<script>
function changeClass(myElementID,newClassName) {
document.getElementById(myElementID).className = newClassName;
}
</script>
</head>
<body onload="changeClass('myDiv','mycoolnewclass')">
<div class="someoldclass" id="myDiv">
Lorem ipsum dolor sit amet.
</div>
</body>
Bookmarks