bootstrap modal popup disable click outside

To disable clicking outside of a Bootstrap modal popup, you can use the backdrop option. By setting the value of the backdrop option to "static", you can prevent the modal from being closed when the user clicks outside of it.

Here is an example of how you can achieve this:

<div class="modal" id="myModal" data-backdrop="static">
  <div class="modal-dialog">
    <div class="modal-content">
      <!-- Modal content goes here -->
    </div>
  </div>
</div>

In this example, the data-backdrop="static" attribute is added to the modal element. This will prevent the modal from being closed when the user clicks outside of it.

You can also achieve the same effect programmatically using JavaScript. After initializing the modal, you can set the backdrop option to "static" using the modal method:

$('#myModal').modal({
  backdrop: 'static'
});

By setting the backdrop option to "static", the user will not be able to close the modal by clicking outside of it.

That's it! The above methods allow you to disable the ability to click outside of a Bootstrap modal popup.