jquery – focus() – set focus on input field (textarea) inside a Bootstrap modal on activation

 

$(document).ready(function(){
    $("#myModal").on('shown.bs.modal', function(){
        $(this).find('#myInputName').focus();
    });
});