Problem bei using the Toast.Widget

Hey everybody,

i’am using the Yii Bootstrap Toast Widget to display a toast message like

echo  Toast::widget([
    'id'=>'newMessage',
    'title' => 'New Message',
    'body' => 'You have new messages...',
    'options'=>[ 'role'=>'alert'],
]);

Than i display them with an JavaScript like this:

                myAlert1= document.getElementById(\'newMessage\'); 
                var bsAlert1 = new bootstrap.Toast(myAlert1); 
                bsAlert1.show();

The Toast displayed, but after the html-code disappears from my site and i can’t call the display function again. Can anyone tell me if this is a bootstrap issue or yii issue?