Hey all I'm a student and I need to check a div's class. This seems like it should work but it's not... Help please! :)
<script type="text/javascript">
function findout()
{
alert('function works');
var var1 = document.getElementById("div1").className;
if (var1.value == "special")
{
alert("div1 has special as a style");
document.getElementById("div1").className = '';
}
else
{
document.getElementById("div1").className = 'special';
}
}
window.onload = findout();
</script>