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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:48:42+00:00 2026-06-01T17:48:42+00:00

ok I have been working on this webpage for a week now and have

  • 0

ok I have been working on this webpage for a week now and have hit a wall. the code is in place except getting the getelementbyid to function. I am trying to make the images in the frame div to change by changing the javascript source when you select an image in the sidebar.
What I was wondering is if there is a problem in my code or if the function just doesnt work that way.

<head>
<title>Rivas2</title>
<script id="newset" src="sidescroll.js" type="text/javascript"></script>
<script type= "text/javascript">

function changesrc() {
var sets = document.getElementById('newset');   
switch (value) {
 case '1': sets.src = 'sidescroll.js'; break;
 case '2': sets.src = 'sidescroll2.js'; break;
      }
    }
     </script>
   <style type="text/css">
        body{
background-color:#66FFFF;
}
   .banner{
position:absolute; 
top: 15px; 
left: 300px;}
.sideb1{
position:absolute;
top: 120px;
left: 25px;
height: 530px;
width: 150px;
overflow: auto;}
.frame{
position:absolute; 
top: 120px; 
left: 400px;}   
  .scroll{
position: absolute;
top: 525px;
left: 400px;
}

  </style>
  </head>

  <div class="sideb1" >
    <input type = 'image' src = 'image3.jpg' onclick = 'changesrc(1)' width= "120"           height= "100" alt= " " /><br/> House 1<br/>
    <input type = 'image' src = 'image3.jpg' onclick = 'changesrc(2)' width= "120" height= "100" alt= " " /><br/> House 2<br/>
    <a href="rivas2.html" ><img src="image3.jpg" width= "120" height= "100" alt="" /> </a><br/> House 3<br/>
    <a href="rivas3.html" ><img src="image3.jpg" width= "120" height= "100" alt="" /> </a><br/> House 4<br/>
    <a href="rivas2.html" ><img src="image3.jpg" width= "120" height= "100" alt="" /> </a><br/> House 5<br/>
</div>   
  • 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-01T17:48:44+00:00Added an answer on June 1, 2026 at 5:48 pm

    You need to include the argument when you build the function, try this:

    function changesrc(value) {
        var sets=document.getElementById('newset');   
        switch(value) {
            case(1):
                sets.src='sidescroll.js';
                break;
            case(2):
            default:
                sets.src='sidescroll2.js';
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been working on this problem for 2 days now and it's an
I have been working on this problem for a while now. I am trying
I have been working on this for 24 hours now, trying to optimize it.
I have been working on this for some time now and just cant quite
Have been working on this question for a couple hours and have come close
I have been working on this app for at least 3-4 months and just
I have been working on this sort of ATM (With a maximum of 50
I have been working on this for few hours and got stuck, so how
I have been working on this application that enables user to log in into
I have been working on this for days but I don't get it so

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.