Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
%ul.nav.nav-tabs %li.active %a{ :href => "#a", "data-toggle" => "tab" } %li %a{ :href => "#b", "data-toggle" => "tab" }
如何在第二个选项卡上调用 jQuery 单击功能?
$('.nav-tabs li').eq(1).click(function(){alert("test")})
或者如果你想调用click事件:
click
$('.nav-tabs li').eq(1).click()
$('#b').parent().click(function(){alert("test")});
我想这就是你的意思。