user1025275
user1025275

Reputation: 198

How to call jQuery click function on a tab

%ul.nav.nav-tabs
  %li.active
  %a{ :href => "#a", "data-toggle" => "tab" }
  %li
  %a{ :href => "#b", "data-toggle" => "tab" }

How can I call jQuery click function on the second tab?

Upvotes: 1

Views: 1062

Answers (2)

Dmitry Stratsevsky
Dmitry Stratsevsky

Reputation: 21

$('.nav-tabs li').eq(1).click(function(){alert("test")})

or if you want to call click event:

$('.nav-tabs li').eq(1).click()

Upvotes: 2

Horus
Horus

Reputation: 1175

$('#b').parent().click(function(){alert("test")});

I think this is what you mean.

Upvotes: 0

Related Questions