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 7955743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T03:47:06+00:00 2026-06-04T03:47:06+00:00

Currently my code looks like this: <div id=content> <div id=1> <img src= alt= onmouseover=document.getElementById(‘1’).style.visibility

  • 0

Currently my code looks like this:

<div id="content">
<div id="1">
<img src="" alt="" onmouseover="document.getElementById('1').style.visibility = 'visible'; document.getElementById('2').style.visibility = 'hidden'; document.getElementById('3').style.visibility = 'hidden'; document.getElementById('4').style.visibility = 'hidden';" />
<div id="1_content>content</div>
</div>

<div id="2">
<img src="" alt="" onmouseover="document.getElementById('2').style.visibility = 'visible'; document.getElementById('1').style.visibility = 'hidden'; document.getElementById('3').style.visibility = 'hidden'; document.getElementById('4').style.visibility = 'hidden';" />
<div id="2_content">content</p>
</div>

<div id="3">
<img src="" alt="" onmouseover="document.getElementById('3').style.visibility = 'visible'; document.getElementById('1').style.visibility = 'hidden'; document.getElementById('3').style.visibility = 'hidden'; document.getElementById('4').style.visibility = 'hidden';" />
<div id="3_content">content</div>
</div>

<div id="4">
<img src="" alt="" onmouseover="document.getElementById('4').style.visibility = 'visible'; document.getElementById('1').style.visibility = 'hidden'; document.getElementById('2').style.visibility = 'hidden'; document.getElementById('3').style.visibility = 'hidden';" />
<div id="4_content>content</div>
</div>

</div><!-- content -->

Each div is positioned in the same place. How would I create a function to perform this? I only ask because the code doesn’t validate with the DTD I’m using so I”d like to fix that. Also, because the divs are on top of each other, when I make one visible, I can’t highlight text in the visible div because its z-index remains the same and so the content is locked behind an invisible div. How would I fix this? Finally, would I simply call the function in the html with onmouseover="return functionName()"? Will that validate in XHTML1.0 Strict?

  • 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-04T03:47:07+00:00Added an answer on June 4, 2026 at 3:47 am

    I am guessing that you need something like this:

    <html><head>
    <script>
    function makeVisible(pName) 
    {
      var item = document.getElementById(pName);
      var contentPanel = document.getElementById("content");
      var contents = contentPanel.getElementsByTagName("p");
    
      for (var i = 0; i < contents.length; i++) {
        if (contents[i] != item) {
          contents[i].style.display = "none"
        }
      }
      item.style.display = "";
    }
    </script>
    </head>
    <body>
    <div id="content">
    <div><img src="" alt="" onmouseover="makeVisible('p1')" /></div>
    <div><img src="" alt="" onmouseover="makeVisible('p2')" /></div>
    <div><img src="" alt="" onmouseover="makeVisible('p3')" /></div>
    <div><img src="" alt="" onmouseover="makeVisible('p4')" /></div>
    
    <p id="p1">content 1</p>
    <p id="p2">content 2</p>
    <p id="p3">content 3</p>
    <p id="p4">content 4</p>
    
    </div><!-- content -->
    </body></html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got HTML code that roughly looks like this: <li id=someid-11> <img src=... alt=alt
My code currently looks like this: <div style=position: fixed; width: 35.25%; height: 6.75%; left:
I'm refactoring some code that currently looks like this: $$('#wrapper > div').each(function(e){ if((e.id!='header') &&
My code currently looks like this: private Foo myFoo; public Foo CurrentFoo { get
I have an Entity in Code First Entity framework that currently looks like this:
I currently have a div whose css looks like this: .class { overflow:auto; resize:
So... currently, the form submission looks like this: suggested_text is empty. but I use
I have, for example, markup like this <div id=content> <p>Here is some wonderful text,
I'm implementing a small HTTP server with Ruby using Mongrel. My code currently looks
So this code looks fine, I can't seem to see where the error is

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.