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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T04:29:21+00:00 2026-06-19T04:29:21+00:00

I am using twitter bootstrap collaspe function. the li elements are as below and

  • 0

I am using twitter bootstrap collaspe function. the li elements are as below and the each of the tab content consist of a input element of class .attrInputs

When I click on the element of class pill, I want the input element in each tab to focus so that user dont need to click the input element. I add some jquery to do this using the .focus when class of .pill is clicked on, but its only possible on the second click not the first click.

   <ul class="nav nav-pills">
           <li>
              <a class="pill" href="#a" data-toggle="pill">
                A
              </a>
           </li>
           <li>
               <a class="pill" href="#b" data-toggle="pill">
                B
               </a>
           </li>
    <ul>

My tab content. The html is the same for every tab

<div class="span10 offset1 tab-pane active" id="collar">
    <div class="span4">
          <input class="attrInputs" name="collar" type="text">
    </div>
    <div class="span4 offset1">
          <img src="http://placehold.it/300x300/156153">
    </div>
</div>

$('.pill').on('click',function(){
   $('.attrInputs').focus(); 
});

Thanks in advance

  • 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-19T04:29:22+00:00Added an answer on June 19, 2026 at 4:29 am

    You can try:

    $('.pill').on('click',function(){
       setTimeout(function() {
         $('.attrInputs').focus(); 
       },0);
    });
    

    setTimeout() will break the chain of click handlers.

    For more information, see https://github.com/twitter/bootstrap/issues/2380

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

Sidebar

Related Questions

Using Twitter Bootstrap's bootstrap-tab.js, I have: <ul class=tabnavcenter id=myTab> <li class=active><a href=#home data-toggle=tab>about</a></li> <li><a
Using Twitter Bootstrap's [Tabbable Tabs][1], it says to: Enable tabbable tabs via javascript (each
I am using twitter bootstrap typehead. $(document).ready(function() { $(#searchfield).typeahead({ minLength: 3, source: [type1, type2,
I am attempting to build a simple content management system using Twitter's Bootstrap for
using twitter bootstrap typeahead i get google chrome suggestion list above typeahead list $(document).ready(function
I am using Twitter Bootstrap's tabs to hold an accordion of FAQs within each
I am using Twitter bootstrap, for an image gallery : <ul class=listing> <li class=listing-box
Using twitter-bootstrap, how do I decorate my input tag with an icon? I've tried:
When using Twitter Bootstrap 2.1.0, and using HTML like this: <div class=row> <div class=span10>
Using twitter bootstrap, and I need to initiate active class to the li portion

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.