Lil_Missae
New Member
In my site i built a textual menu as menu.html inside iframe.each href i put in seperate div. i wanted that according to title of parent page the class of one of the divs will be changed (for example:if title of parent is "home" then class of the aforementioned div changes to 'marked'). i have tried the following script but still it deosn't work. what is wrong? thanks again!\[code\]<html> <head> <title>something</title> <script type="text/javascript"> switch (window.parent.document.title) { case "main": windows.parent.document.getElementById("class1").setAttribute("class","marked"); case "About": windows.parent.document.getElementById("class2").setAttribute("class", "marked"); case "Interesting facts": document.getElementById("class3").setAttribute("class", "marked"); default: alert("I failed, sorry! "); } </script> </head> <body></body> </html>\[/code\]