Hi,
Is it possible to change the CSS class of a div object by re-writing the innerHTML ?
I have some menus in a left hand pane that are orange - this is set up by naming them class=“orangeMMbuttons” and using CSS.
I then have a drop down field that calls another page into the main frame. In the onload event of this page I then change the buttons to suit the new content. This involes changing their colour, href and title.
The href and title change OK but the class change doesn’t seem to affect the colour of the button - any reason why this should be ?
Thanks
Paul
Example Code
The source code from the opening page
The onload of the new called page:
top.document.getElementById('lb1').innerHTML="<div id=\"lb1\" class=\"" + frm.menuColour.value + "MMbuttons\"><a href=\"" + frm.buttonLink1.value + "\" title=\"" + frm.buttonTitle1.value + "\">" + frm.buttonTitle1.value + "</a></div>";
top.document.getElementById('lb2').innerHTML="<div id=\"lb2\" class=\"" + frm.menuColour.value + "MMbuttons\"><a href=\"" + frm.buttonLink2.value + "\" title=\"" + frm.buttonTitle2.value + "\">" + frm.buttonTitle2.value + "</a></div>";
top.document.getElementById('lb3').innerHTML="<div id=\"lb3\" class=\"" + frm.menuColour.value + "MMbuttons\"><a href=\"" + frm.buttonLink3.value + "\" title=\"" + frm.buttonTitle3.value + "\">" + frm.buttonTitle3.value + "</a></div>";
top.document.getElementById('lb4').innerHTML="<div id=\"lb4\" class=\"" + frm.menuColour.value + "MMbuttons\"><a href=\"" + frm.buttonLink4.value + "\" title=\"" + frm.buttonTitle4.value + "\">" + frm.buttonTitle4.value + "</a></div>";
top.document.getElementById('lb5').innerHTML="<div id=\"lb5\" class=\"" + frm.menuColour.value + "MMbuttons\"><a href=\"" + frm.buttonLink5.value + "\" title=\"" + frm.buttonTitle5.value + "\">" + frm.buttonTitle5.value + "</a></div>";
top.document.getElementById('lb6').innerHTML="<div id=\"lb6\" class=\"" + frm.menuColour.value + "MMbuttons\"><a href=\"" + frm.buttonLink6.value + "\" title=\"" + frm.buttonTitle6.value + "\">" + frm.buttonTitle6.value + "</a></div>";
top.document.getElementById('lb7').innerHTML="<div id=\"lb7\" class=\"" + frm.menuColour.value + "MMbuttons\"><a href=\"" + frm.buttonLink7.value + "\" title=\"" + frm.buttonTitle7.value + "\">" + frm.buttonTitle7.value + "</a></div>";