1<!-- opening with html, the key is the data-backdrop="static" attribute -->
2<button data-target="#myModal" data-toggle="modal" data-backdrop="static" data-keyboard="false">
3 Launch demo modal
4 </button>
5
6<script>
7//Opening with JS:
8$('#myModal').modal({backdrop: 'static', keyboard: false})
9</script>