How to can you clear the bootstrap modal on dismiss/hide/close?
I have the following Modal definition:
this is the easiest fix:
$('#myModal').on('hidden.bs.modal', function () {
$(this).find("input,textarea,select").val('').end();
});
Use val('')
based on input types present and use #myModal
instead of body
$('#myModal').on('hidden.bs.modal', function () {
$('.modal-body').find('textarea,input').val('');
});
DEMO
This worked for me
$('body').on('hidden.bs.modal', '.modal', function () {
$(".modal-content").empty();
});