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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:24:56+00:00 2026-06-12T13:24:56+00:00

I have a tab menu where users can add and delete tabs like they

  • 0

I have a tab menu where users can add and delete tabs like they want. When creating a new tab, they name it as they like (a bootstrap modal box opens for that). After naming the tab the tab gets created, but I don’t know what to do with the content. I need to load the same content for every tab added, I’v tried all sorts of scripts that I’v found online, but nothing seems to work.

This is the jQuery that I use:

$('.tabs a:last').tab('show');
        $('#createTab').click(function() {
            /* opens the modal box */
            $('#tabModal').modal();
        });
/* after clicking on a link Submit that has the id of newTab */
        $('#newTab').click(function(){
            var title = $('#myInput4').val();
            $('#tabHeaders')
                .append($('<li><a href="#' + title + '" class="tabs"><h1>'+ title +'<i class="icon-remove"></i></h1></a></li>'));
            $('#myTabContent') /* this way adding content does not really work */
                .append($('<div class="tab-pane fade in active" id="'+ title +'"></div>')); 
            $(title).tab('show');
        });
    /* tab delete */
    $('.tabs i.icon-remove').live('click', function() {
       $(this).closest('li').remove();
    });

HTML for adding button:

<ul class="nav nav-tabs" id="tabHeaders">
  <li><a href="#" data-toggle="tab" id="createTab"><h1>&nbsp;&nbsp;<i class="icon-plus"></i>&nbsp;&nbsp;</h1></a></li>
</ul>

I would appreciate if somebody could help me to load the content. I’ve created a file addTab.php that I would like to get loaded in the content part – when the user clicks on #createTab, first they choose the name for the tab and then the content gets loaded to that tab.

  • 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-12T13:24:57+00:00Added an answer on June 12, 2026 at 1:24 pm

    example test:

    <ul class="nav nav-tabs" id="myTab">
        <li class="active"><a href="#home">Home</a></li>
        <li><a href="#profile">Profile</a></li>
        <li><a href="#messages">Messages</a></li>
        <li><a href="#settings">Settings</a></li>
    </ul>
    
    <div class="tab-content">
        <div class="tab-pane active" id="home">...</div>
        <div class="tab-pane" id="profile">...</div>
        <div class="tab-pane" id="messages">...</div>
        <div class="tab-pane" id="settings">...</div>
    </div>
    

    to add tab just do this :

    $(document).on('click', '#submit_button_in_the_modal', function(event){
        event.stopPropagation();
    
        var title = $('#myInput4').val();
        $('#tabHeaders').append('<li><a href="#new_tab_id" data-toggle="tab">'+ title +'</a></li>');
        $('.tabs a:last').tab('show');
    
        //this remove the active content
        $('div.active').removeClass('active').removeClass('in');
    
        //this add the new content
        $('.tab-content').append('<div class="tab-pane in active" id="new_tab_id"><p> Loading content ...</p></div>');
        //with this you add the tab
        $('#myTab').append('<li><a href="#new_tab_id" data-toggle="tab">Tab Name</a></li>');
        //this shows the tab
        $('#tab a:last').tab('show');
        //this loads the content you want in the content
        $('#new_tab_id').load('addTab.php');    
    })
    

    try this please.

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

Sidebar

Related Questions

I have magento 1.5.1.0 and I want to add an extra menu or tab
So I have a tab menu, SO i.e. And once clicking on the tabs
In my portfolio site I have listed my projects under separate tabs (tab menu).
I'm creating a module that let's your users add feeds. So i want my
I have the following HTML code based on a tab menu format, i.e: <div
I have been following a short tutorial to build a tab menu on my
I have created a horizontal menu with 5 tab options using a ul and
I have a tab delimited file which looks like this: CHROM <TAB> POS <TAB>
I have a side navigation menu that I want to be able to utilize
I have a main activity. It's main purpose is to handle Tab menu. If

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.