no, and no. here is my test code so you know it's not my fault:
<style>
.class1 {font-size:40px}
.class2 {font-size:10px}
</style>
<script>
document.getElementById("mydiv".setAttribute("class","class2" //here is where i tried the other ways as well.
</script>
<div class="class1" id="mydiv">fggeergreterg</div>
ok, i apologise. after swiming through devedge (netscape's developer site) className turns out to be correct. question though, why dose my code not work?
<script>
document.getElementById("mydiv".setAttribute("class","class2" //here is where i tried the other ways as well.
</script>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.