Javascript focus first visible input in Boostrap modal

Categorías: 

Etiquetas: 

// focus first visible element after load Bootstrap modal
$('.modal').on('shown.bs.modal', function (e) {
    $(this).find('input, textarea, select').filter(':visible:first').focus(); 
});