bootstrap 5 modal form code example
Example 1: bootstrap modal
$('#myModal').on('shown.bs.modal', function () {
$('#myInput').trigger('focus')
})
Example 2: bootstrap 4 modal
$('#myModal').on('shown.bs.modal', function () {
$('#myInput').trigger('focus')
})