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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T15:28:53+00:00 2026-05-21T15:28:53+00:00

I have some tabs created with jquery and i want to add new tabs.

  • 0

I have some tabs created with jquery and i want to add new tabs. The method I am using is giving a class “extend” to the anchors which I want to create a new tab and removing their default functionality. Then I load the content into the newly created div. The problem is that the class “extend” anchors in the ajax loaded content don’t inherit this particular behavior. Any help is appreciated.Thank you.
Code:

 $(function(){
    $("#tabs").tabs();
    $("a.extend").click(function(event) {
    event.preventDefault();
    var $name=$(this).attr("name");
    var $link=$(this).attr("href");
    $("#tabs").tabs("add", "#"+$name,$(this).attr("name"));
    $("#"+$name).load($link);
    //$(".extend").click(function(event){ event.preventDefault();}); this didn't fix it
    });
    });
  • 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-21T15:28:54+00:00Added an answer on May 21, 2026 at 3:28 pm

    Simplest thing to do is use jQuery’s “.delegate()” to handle the “click” events:

    $('body').delegate('a.extend', 'click', function(event) {
      // your code here, as in your question
    });
    

    That puts an event handler on the <body> tag that waits for “click” events to bubble up, and then for those whose actual target element is an <a> with class “extend”, it dispatches to the handler. That will work for <a> elements there originally as well as those added later.

    You don’t have to put the handler on the <body> tag; you could put it at any convenient parent element containing the anchors.

    The “.delegate()” function is like the “.live()” function, but personally I like it better because it’s more flexible, more “jQuery-like”, and a little more efficient.

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

Sidebar

Related Questions

I have some tabs using jQuery UI which work just fine, but I want
I have this jQuery ajax navigation tabs plugin that I created using some help
I have some tabs created with jQuery UI After I create a new tab
I have created bottom fixed tabs using jquery mobile data-role=navbar inside a JQ footer.
I'm using the tabs control in jquery ui. I add new tabs dynamically based
I have a set of tabs done using jquery-ui. I do not want the
I have created some rounded navigation tabs using CSS and am having trouble when
I have some jQuery tabs on a website and I am trying to make
I'm making some tabs and I want to have my own delegate for them
I have some jquery tabs on my page the code for them is: //tabs

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.