Bootstrap 3 jquery event for active tab change

前端 未结 6 1457
挽巷
挽巷 2020-11-28 17:22

I spent an unrealistic amount of time trying to fire a function when the tab changes of the bootstrap 3 tab/navbar and literally all suggestions google spat out wer

6条回答
  •  醉酒成梦
    2020-11-28 18:04

    I use another approach.

    Just try to find all a where id starts from some substring.

    JS

    $('a[id^=v-photos-tab]').click(function () {
         alert("Handler for .click() called.");
    });
    

    HTML

    Cool photos
    

提交回复
热议问题