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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:54:48+00:00 2026-06-05T22:54:48+00:00

I want to use jQuery tabs ( http://jsfiddle.net/43FcS/2/ ) inside a div that’s created

  • 0

I want to use jQuery tabs (http://jsfiddle.net/43FcS/2/) inside a div that’s created with javascript.

Right now I’m creating a shop locator for a shop that I’m working at. I’m using the jQuery shop locator plugin, created by Bjorn (http://www.bjornblog.com/web/jquery-store-locator-plugin).

When the user clicks search the search results (4 closest shops to the entered address) will be listed. In each li I thought of creating a div with a class “shoptab”. In each div I want to have the 2 tabs (address and opening hours) shown, as in the link above.
My javascript creates the li with the following function:

$('<li />').html("<div class=\"shoptab\"><h2 class=\"loc-name\"> Shop " + storeName + "<\/h2> <ul><li><a href=\"#tabs-1\">Address<\/a><\/li> <li><a href=\"#tabs-2\">Opening hours<\/a><\/li><\/ul> <div id=\"tabs-1\"><p>" + storeAddress1 + "<\/p> <p>" + storeAddress2 + "<\/p> <p>" + storeCity + ", " + storeState + " " + storeZip + "<\/p> <p>" + storePhone + "<\/p> <\/div> <div id=\"tabs-2\"><p>" + storeHours1 + "<\/p> <p>" + storeHours2 + "<\/p> <p>" + storeHours3 + "<\/p> <\/div><\/div>")

I know I cannot use the ids tabs-1 and tabs-2 as they would be used several times, but for now I just wanted them to atleast show up and then afterwards adjust the code to give the div’s ids 1,2,3,4 etc.

My function to the jQuery tabs is written at the bottom of the document together with my shoplocator function.

$(function() {
        $(".shoptab").tabs();
    });

The jQuery ui script doesn’t apply the classes to the shoptab div and ul/li within and I can’t figure out how to make it work.

I hope with this information you can help me out.

  • 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-05T22:54:50+00:00Added an answer on June 5, 2026 at 10:54 pm

    I think the problem is that $(".shoptab").tabs(); is called before there is required html present in the document.

    You should call $(".shoptab").tabs(); after you have inserted the HTML in the document i.e. after all of the

    $('<li />').html("<div class=\"shoptab\"><h2 class=\"loc-name\"> Shop " + storeName + "<\/h2> <ul><li><a href=\"#tabs-1\">Address<\/a><\/li> <li><a href=\"#tabs-2\">Opening hours<\/a><\/li><\/ul> <div id=\"tabs-1\"><p>" + storeAddress1 + "<\/p> <p>" + storeAddress2 + "<\/p> <p>" + storeCity + ", " + storeState + " " + storeZip + "<\/p> <p>" + storePhone + "<\/p> <\/div> <div id=\"tabs-2\"><p>" + storeHours1 + "<\/p> <p>" + storeHours2 + "<\/p> <p>" + storeHours3 + "<\/p> <\/div><\/div>") 
    

    has executed

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

Sidebar

Related Questions

I want to use Openlayers inside jquery ui tabs but I get error: size
I want to use Jquery UI Tabs to make three tabs that all contain
I have an asp.net user control on which I want to use jquery ajax.
I want to use javascript / jquery to determine if an xml file exists.
I use jquery ui tabs http://jqueryui.com/demos/tabs/#default and i allow the user to create a
I want to use jQuery tabs as a navigator, i.e. the tabs shouldn't actually
I want to use jQuery Validation Plugin with jQuery UI Tabs . How I
I use jquery for ajax tabs, not jquery UI that is to large for
I want use JQuery mobile for the front-end of my mobile application, but I
I want use jQuery in my project. I know the javascript_include_tag calls the jQuery

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.