If you're looking to build a modal without relying on bootstrap, consider using Javascript and CSS instead. A helpful resource to get started is w3schools, where you can find a guide with examples that you can customize to suit your needs.
Although your code may resemble the examples provided on the website, it's beneficial to follow their explanations for styling modals similar to those in bootstrap. Pay close attention to the .modal
css section, particularly when declaring the z-index
.
Additionally, include Step 3 in your JavaScript code, focusing on this snippet:
// When the user clicks anywhere outside of the modal, close it
window.onclick = function(event) {
if (event.target == modal) {
modal.style.display = "none";
}
}