Connect to bootstrap widget event in view


I tried to connect to an event of the bootstrap tab widget from yii.

In the documentation it ill be possible in the following way:

$tabs = new \yii\bootstrap\Tabs([


    'items' => [['label'=>'a', 'content'=>'b'], ['label'=>'c', 'content'=>'d']]


$tabs->on('', function ($event)


    var_dump('trigger done');


echo $tabs->run();

But this does not work for me. Via javascript, I can see, that the event will be fired, but only, if I embeds this in the $(document).ready function:



    $(document).on('', function (e) {

        alert('TAB CHANGED');



Does anybody have an idea whats wrong?

Thank you in advance.