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 'data-remote' (jQuery.load method) from separate HTML file, so
$(document).on('shown', ".modal", function() {
$('[autofocus]', this).focus();
});
works only if modal was loaded before.
The question is - how to make autofocus work at the first time modal loads?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…