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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:00:09+00:00 2026-06-04T14:00:09+00:00

I placed bootstrap tabs on my page, and is trying to active one dynamically

  • 0

I placed bootstrap tabs on my page, and is trying to active one dynamically from js. Here’s an example:

<ul class="nav nav-tabs">
<li class="active"><a href="?tab=day">Hot</a></li>
<li><a href="?tab=week">Week</a></li>
<li><a href="?tab=month">Month</a></li>
</ul>

<script>
    $(function () {
      $('.nav-tabs a[href="\\?tab\\=month"]').tab('show');
    });
</script>

But I always got:

Uncaught Error: Syntax error, unrecognized expression; ?tab=month

from jQuery (v1.7.1).

Edit:
I created a fiddle.

  • 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-04T14:00:11+00:00Added an answer on June 4, 2026 at 2:00 pm

    show() tries to active both the tab and its content, but the value of href “?tab=month” is not valid for jQuery to select the content.

    My workaround is:

    <ul class="nav nav-tabs">
    <li class="active"><a href="?tab=day" data-target="#">Hot</a></li>
    <li><a href="?tab=week" data-target="#">Week</a></li>
    <li><a href="?tab=month" data-target="#">Month</a></li>
    </ul>
    
    <script>
    $(function () {
      $('.nav-tabs a[href="?tab=month"]').tab('show');
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've placed panel from this example http://docs.sencha.com/ext-js/4-0/#!/example/dd/dnd_grid_to_grid.html to Ext.window.Window and got an issue: proxy
On this page of the Bootstrap documentation, an example is provided demonstrating the hero
I have placed an image on the master page. I see the image at
I am using the twitter bootstrap css toolkit for building master page for an
I am using Twitter Bootstrap and at one place I have nested fluid-grid in
I am trying to have a modal launch from a link that is in
In attempting to upgrade to Bootstrap 2 (using twitter-bootstrap-rails gem), it seems that page-specific
I am trying to use the Media Plugin (http://www.ohloh.net/p/cakephp-media) I placed the media folder
I'm trying to implement initial data load functionality form a tab delimited text file
We have an MU (Multisite) installation of Drupal7 here at work, and are trying

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.