There is my code which adds class 'nav-pills' to element with class 'nav-tabs' when window width is lower than 768px.
$(window).on('resize', function () {
$('.nav-tabs').toggleClass('nav-pills', $(window).width() < 768);
});
I want to alert something when user click link inside DOM element with these 2 classes (nav-tabs and nav-pills). But nothing happend.
$(".nav-tabs.nav-pills a").click(function(){
alert('test');
});
jQuery toggleClass works fine and add 'nav-pills' to 'nav-tabs' element (I checked it in chrome inspector), but alert wont work.
Anyone can help me?