// Get the modal // Get the button that opens the modal // var btn = document.getElementById("myBtn"); // Get the element that closes the modal // When the user clicks the button, open the modal // When the user clicks on (x), close the modal // When the user clicks anywhere outside of the modal, close it