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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:05:12+00:00 2026-05-11T18:05:12+00:00

There are 2 html files, file-1.htm and file-2.htm. There is another html file, test.htm,

  • 0

There are 2 html files, file-1.htm and file-2.htm. There is another html file, test.htm, with a drop-down having 2 values, “Load Sample-1” and “Load Sample-2”.

This is what I am trying:
When “Load Sample-1” is selected from the drop-down, file-1.htm should be loaded as a nested html in test.htm.

Right now I am able to achieve this through javascript by having the content of file-1.htm and file-2.htm inside test.htm. Bt as the drop-down grows bigger, test.htm would become huge. How can this be achieved by having separate html files for each entry in the drop-down?

  • 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-05-11T18:05:12+00:00Added an answer on May 11, 2026 at 6:05 pm

    Why don’t you just use an <iframe>, and then have the JavaScript dynamically change the source of the iframe?

    Here’s a bare-bones page demonstrating how to use this:

    <html>
    <head>
    <script type="text/javascript">
    var changePage = function() {
        var iframe = document.getElementById("myiframe");  // One of the many ways to select your iframe
        var select = document.getElementById("pageselected");
        var url = select.options[select.selectedIndex].value;
        iframe.src = url;
    }
    </script>
    </head>
    <body>
    <select id="pageselected">
        <option value="page1.html">Page 1</option>
        <option value="page2.html">Page 2</option>
    </select>
    <input type="button" onclick="changePage()" value="Change Page" />
    <iframe id="myiframe"></iframe>
    </body>
    </html>
    

    You may be asking yourself “why did he not just use onchange for the <select>? Well, I’ve got a little war going with <select> + onchange that I detail here, but basically using it makes your website completely inaccessible to keyboard-only users who are using Internet Explorer 6 or 7. (Not sure if it is still broken in 8.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to download only .htm or .html files from my server. I'm trying
Is there a way to convert a HTML string into a Image .tiff file?
I am include a huge javascript file(500K) in my HTML. Is there a smart
Is there a decent way with static HTML/XHTML to create common header/footer files to
There's a HTML: <div class=test> <ul> <li>Item 1</li> <li>Item 2</li> </ul> </div> And a
Is there an HTML color wheel that I can throw in my site that
Are there any html helpers for page navigation. eg. if i have 1000 records
I know there are HTML entities for 1/2, 1/4, and 3/4, but are there
There are some HTML based games (ie bootleggers.us) that have a simple login form
I like HtmlControls because there is no HTML magic going on... the asp source

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.