I have such problem - I need to autofocus some element inside twitter bootstrap modal (after it shows). The tricky part is here - content of this modal is loaded using \'dat
Below is excerpted from: http://getbootstrap.com/javascript/#modals
Due to how HTML5 defines its semantics, the
autofocusHTML attribute has no effect in Bootstrap modals. To achieve the same effect, use some custom JavaScript:$('#myModal').on('shown.bs.modal', function () { $('#myInput').focus() })