Why doesn’t my code work?
<script type="text/javascript">
function barFix(newDiv)
{
var elem = document.getElementById(newDiv);
elem.style.background='#666666';
}
</script>
<div onmouseover="barFix('badgebar1');" id="badgelist">
</div>
<div id="badge1bar" style="background-color: #dddddd; width: 2px; height: 42px;"> </div>
I’ve tried everything.. can’t get it working! Why?
Onmouseover, you’re sending ‘badgebar1’ as a parameter, but there’s no badgebar1, it’s badge1bar.
So either change the id, or the onmouseover code, then it should work.