Hi Campers ,
This is Mohammad Mizanur Rahman a new member for freeCodeCamp forum. I’m developing a Photo gallery Web Application with PHP & MySQL . In front end design part ( menu-option ) I’m facing a problem with default bootstrap modal , I would like to run the modal pop up form by my own script which I coded with javaScript . Please check below :
<script>
<!-- Script For Sign Up Form -->
var modal2 = document.getElementById('myModal2');
var btn2 = document.getElementById("myBtn2");
var span2 = document.getElementsByClassName("close2")[0];
btn2.onclick = function() {
modal2.style.display = "block";
modal3.style.display = "none";
}
span2.onclick = function() {
modal2.style.display = "none";
}
window.onclick = function(event) {
if (event.target == modal2) {
modal2.style.display = "none";
}
}
</script>
Actually after closing this form when I clicked on window that time the default “modal-backdrop” class is not working .