Just starting to play around with bootstrap and it\'s amazing.
I\'m trying to figure this out. I have a textarea for feedback inside a modal window. It works great.
I wanted to have a declarative version of this, so I went with the following :
$(document).ready(function() {
$(".modal").on('shown.bs.modal', function () {
$("[data-modalfocus]", this).focus();
});
});
You can then simply add a data-modalfocus property to your field, like so :
<input type="text" data-modalfocus />
And when the modal pops-up, your field will get focus.