bootstrap tutorial - How to set focus on input field or textarea inside a Bootstrap modal on activation - bootstrap examples - bootstrap templates - bootstrap 3
Answer: Use the jQuery .focus() method
You can use the jQuery .focus() method to set focus on the first input box or textarea inside the Bootstrap modal when its load upon activation, like this:
Example
The jQuery code in the above example simply finds the <input> element and set focus on it when modal is visible to the user using the modal's shown.bs.modal event.