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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:15:37+00:00 2026-06-17T22:15:37+00:00

I want to create a simple build menu with a tabbed view. After i

  • 0

I want to create a simple build menu with a tabbed view.
After i changed something yesterday night it doesn’t work any more.
The switch between the tabs is broken, the content of all tabs will be shown at the first tab

Snippet:

 <div id="builder">
    <div id="wrapper">
  <div id="tabContainer">
    <div class="tabs">
      <ul>
        <li id="tabHeader_1">Page 1</li>
        <li id="tabHeader_2">Page 2</li>
        <li id="tabHeader_3">Page 3</li>
      </ul>
    </div>
    <div class="tabscontent">
      <div class="tabpage" id="tabpage_1">
        <h2>Page 1</h2>
        <p>Pellentesque habitant morbi tristique senectus...</p>
      </div>
      <div class="tabpage" id="tabpage_2">
        <h2>Page 2</h2>
        <p>Pellentesque habitant morbi tristique senectus...</p>
      </div>
      <div class="tabpage" id="tabpage_3">
        <h2>Page 3</h2>
        <p>Pellentesque habitant morbi tristique senectus...</p>
      </div>
    </div>
  </div>
</div>

Sample Code

Source

My Test Site

  • 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-17T22:15:37+00:00Added an answer on June 17, 2026 at 10:15 pm

    This line var pages = container.querySelectorAll(".tabpage"); returns a collection with length 0.

    However, if you change it to var pages = document.querySelectorAll(".tabpage");, it works fine.

    The reason is that your .tabpage aren’t children of your container (which is #tabContainer). Look at your HTML carefully (from your fiddle):

    <div id="tabContainer">  <!-- this is what you set at "container" in JS -->
        <div class="tabs">
            <ul>
                <li id="tabHeader_1">Military</li>
                <li id="tabHeader_2">Supply</li>
                <li id="tabHeader_3">Research</li>
            </ul>
        </div>  <!-- .tabs -->
    </div> <!-- #tabContainer -->
    <div class="tabscontent">
        <div class="tabpage" id="tabpage_1"> <!-- this is NOT a child of #tabContainer -->
    

    This fiddle appears to be working.

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

Sidebar

Related Questions

I've built a simple cms with an admin section. I want to create something
I want to create simple app able to edit images. Main view of app
I try to build a simple iPhone app. I want to create a custom
JavaScript. I want to create simple script, that will be resize loaded image using
I want to create a simple app, where the user can take a photo.
I want to create a simple app that shows me the city of the
I want to create a simple Javascript program with a HTML interface. The program
I want to create a simple server application which runs on the desktop, and
I want to create a simple login functionality in WP7 app using remote MySQL
I want to create a simple bash script to launch a Java program on

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.