Hi,
I am trying to style a parent element with a hover state style. I want to change the background colour when hovered over. I cant edit the html as this is generated automatically from a cms.
HTML example
<td>
<a>
<div id=timetablemenu>Timetable</div>
</a>
</td>
Javascript
var timetablemenuTag = document.getElementById(‘timetablemenu’);
timetablemenuTag.parentNode.parentNode.style.backgroundColor=’#FF0000′;
This works fine but i need to add a rollover background colour change.
I have tried timetablemenuTag.parentNode.parentNode.addClass=”timetable2″; and adding CSS but this doesnt seem to work.
Any ideas/suggestions would be much appriciated,
Thanks,
Tony