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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:08:35+00:00 2026-06-13T18:08:35+00:00

This is what I have so far, I have been watching a ton of

  • 0

This is what I have so far, I have been watching a ton of Javascript videos and I feel I mimicked them solid but this is still not functioning as I want.

Than being, it changes from logo1 to logo2 on mousover. This is homework. However homework that is important to me so any help or guidance would be appreciated.

</head>

<body>
<p>
<div>
<script type="text/javascript">
// Pre load images for rollover
function imgOver(id) 
{
    document.getElementById(id).src="logo1.jpg";
}

function imgOut(id) 
{
    document.getElementById(id).src="logo2.jpg";
}

</script>   
<a href="#" onmouseover="imgOver('logo1');" onmouseout="imgOut('logo2')">
<img alt="logo" height="150" src="images/Logo1.jpeg" width="110" />
</a>
</div>
</body>

</html>

New Code, its still….not working! =(

</head>

<body>
<div>
<p>
<script type="text/javascript">
// Pre load images for rollover
function imgOver() 
{
    document.getElementById('logo').src="images/logo1.jpg"; // ensure correct image path
}

function imgOut() 
{
    document.getElementById('logo').src="images/logo2.jpg"; // ensure correct image path
}
</script>   
<a href="#" onmouseover="imgOver('logo1');" onmouseout="imgOut('logo2')">
<img alt="logo" height="150" src="images/Logo1.jpeg" width="110" />
</a>
</p>
</div>
</body>

</html>
  • 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-13T18:08:36+00:00Added an answer on June 13, 2026 at 6:08 pm

    You need not pass the image element’s ID to your imgOver and imgOut functions since the ID never changes, your functions should be changed to:

    function imgOver() {
        document.getElementById('logo').src="logo1.jpg"; // ensure correct image path
    }
    
    function imgOut() {
        document.getElementById('logo').src="logo2.jpg"; // ensure correct image path
    }
    

    Secondly, ensure you specify the correct path to logo1.jpg and logo2.jpg. For example: form your original HTML it looks like you’ll need to use images/logo1.jpg and images/logo2.jpg respectively.


    Your image element needs to have an ID. <img id="logo" alt="logo" height="150" src="images/Logo1.jpeg" width="110" />

    Full Source:

    <script type="text/javascript">
    function imgOver() {
        document.getElementById('logo').src="images/logo1.jpg"; // ensure correct image path
    }
    function imgOut() {
        document.getElementById('logo').src="images/logo2.jpg"; // ensure correct image path
    }
    </script>   
    <a href="#" onmouseover="imgOver()" onmouseout="imgOut()">
        <!-- note the id="logo" part below -->
        <img id="logo" alt="logo" height="150" src="images/Logo1.jpeg" width="110" />
    </a>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This has / may have been asked before, but, as far as I remember,
I'm trying to use suds but have so far been unsuccessful at figuring this
I've been trying for a whlie on this, and have so far been failing
I have been using this so far system 'strings binary-file.dmp | grep search_string' Is
I have been searching for a solution to this and so far found nothing
Thus far you guys have been wildly helpful with me getting this little ditty
I have been trying to get this jsfiddle to work. So far without luck.
I have this so far but the Column 'name' is ambiguous, so I want
I have this so far but I don't know how to write over the
Following on from this question , I have so far been unable to rearrange

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.