Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8647423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:04:03+00:00 2026-06-12T13:04:03+00:00

In my site i built a textual menu as menu.html inside iframe.each href i

  • 0

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!

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> </title>
<link rel="stylesheet" type="text/css" href="style.css" />
<script type="text/javascript">
switch (window.parent.document.title) {
case "hoempage":document.getElementById("nada1").className="marked"; break;
case "about": document.getElementById("nada2").className = "marked"; break;
        case "jokes": document.getElementById("nada3").className = "marked"; break;
        case "freewares": document.getElementById("nada4").className = "marked"; break;
        case "links": document.getElementById("nada5").className = "marked"; break;
        default: alert("god damn!"); break;
    }

</script>
</head>
<body dir="rtl">
<ul class="menu1">
<li><a href="Index.html" target="_parent"><div id="nada1">homepage</div></a></li>
<li><a href="About.html" target="_parent"><div id="nada2">about</div></a>  </li>
<li><a href="Jokes.html" target="_parent"><div id="nada3">jokes</div></a></li>
<li><a href="freewares.html" target="_parent"><div id="nada4">freewares</div></a>    </li>
<li> <a href="NetGames.html" target="_parent"><div id="nada5">links</div></a>    </li>
</ul>
<br /><br /><hr />
<div class="write_mail">if you want to rgister to site updates enter name + email:
<form action="sent.php" method="post" >
    <input type="text" name="subscr" /><br />email
    <input type="text" name="perosnal"/><br />name
    <br />
    <input type="submit" name="submit" onclick="alert('good job and thanks!');"/>    </form></div>

</body>
</html>

edited: i tried the solutions but nevertheless it still decline working. here is the parent code:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>homepage</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body dir="rtl">
<iframe src="menu.html" class="navibar" height="430px" width="50px" scrolling="no" style="border-style:none"></iframe>
<br />
<p class="About">built by zetta the beginner 2012<br /> 
</p>
</body>
</html>

and the menu.html is the code i updated at the begining of the message.
sorry again for harassment 🙁

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T13:04:04+00:00Added an answer on June 12, 2026 at 1:04 pm

    page that embed the iframe code as follow:

          <html>
    <head>
    <title>main</title>
    <style>
    .marked{background:yellow}
    </style>
    </head>
    <body>
    <div id="class1">dddddddddddddddd</div><div id="class2">dddddddddddddddd</div>
    <iframe src="iframe.htm"></iframe>
    </body>
    </html>
    

    iframe page code:

        <html>    
        <head>   
        <title>something</title>
        <script type="text/javascript">       
        switch (window.parent.document.title) {         
            case  "main": window.parent.document.getElementById("class1").className = "marked";break;
            case "About": window.parent.document.getElementById("class2").className = "marked";break;
            case "Interesting facts":             
        document.getElementById("class3").className =  "marked";break;
            default: alert("I failed, sorry! :(");   break; 
         }    
        </script>   
        </head>
        <body></body>  
        </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very complicated site built on CSS3 that has html elements 3d-transformed,
I'm working on a fairly large web site built in PHP that will potentially
This site is built using CakePHP 1.2* I have an element that needs to
I have a Drupal site built on a shared host and I'm finding that
I have a site built using MVC 2. My problem is that Response.End() causes
I have a web site built using ASP.NET MVC4 that I can publish fine
To ensure that my site is friendly to non-javascript users, I've built it without
I have a site built in Ruby On Rails which has many ads in
Currently working on a site built in Django and i'm getting an issue when
I've got a WebForms site built using Progressive Enhancement which uses Master pages. Obviously,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.