У меня есть внешняя ссылка внутри моего модального кода, и я хочу, чтобы модальная скрыть после того, как пользователь нажал на ссылку. Как это сделать?
Вот мой код:
<div class="modal hide fade" id="modalwindow">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3>Title</h3>
</div>
<div class="modal-body">
<p>You need to search on google for that.</p>
</div>
<div class="modal-footer">
<a id="closemodal" href="#" onclick="location.href='https://www.google.com'; return false;" class="btn btn-primary" target="_blank">Launch google.com</a>
</div>
</div>
<script type="text/javascript">
$('#closemodal').modal('hide');
</script>