I did used $('#advocate').focus(); after model is about to close but is does not worked
Asked
Active
Viewed 134 times
-2
Ajay Takur
- 6,079
- 5
- 39
- 55
-
Possible duplicate of [Bind a function to Twitter Bootstrap Modal Close](http://stackoverflow.com/questions/8363802/bind-a-function-to-twitter-bootstrap-modal-close) – Dekel Aug 10 '16 at 13:12
1 Answers
0
I have the same problem. $('#inputId').focus(); works fine when modal is hidden or when input is part of open modal. Focus after modal closing should work(other functions like $('#inputId').val() works fine), but it doesn't:
$('#myModal').on('hidden.bs.modal', function () {
$('#inputId').focus();
});
Exik
- 218
- 1
- 2
- 11