I want to close bootstrap modal box conditionally. If I use $(\'#modal\').modal(\'hide\'); this, some thing goes wrong with my code. And If I use data-di
$(\'#modal\').modal(\'hide\');
data-di
Make another button like this
Cancel
This button contains data-dismiss="modal" .You can hide this if you want.
data-dismiss="modal"
Now You can use any other function in a customized way and when you want to hide the modal you can call
$(".btn-warning").click();