File tree Expand file tree Collapse file tree 1 file changed +0
-11
lines changed Expand file tree Collapse file tree 1 file changed +0
-11
lines changed Original file line number Diff line number Diff line change 82
82
</ div >
83
83
</ div >
84
84
< script >
85
- // Get the modal
86
85
var modal = document . getElementById ( "myModal" ) ;
87
-
88
- // Get the button that opens the modal
89
86
var btn = document . getElementById ( "myBtn" ) ;
90
-
91
- // Get the <span> element that closes the modal
92
87
var span = document . getElementsByClassName ( "close" ) [ 0 ] ;
93
-
94
- // When the user clicks on the button, open the modal
95
88
document . addEventListener ( "DOMContentLoaded" , function ( ) {
96
89
modal . style . display = "block" ;
97
90
} ) ;
98
-
99
- // When the user clicks on <span> (x), close the modal
100
91
span . onclick = function ( ) {
101
92
modal . style . display = "none" ;
102
93
}
103
-
104
- // When the user clicks anywhere outside of the modal, close it
105
94
window . onclick = function ( event ) {
106
95
if ( event . target == modal ) {
107
96
modal . style . display = "none" ;
You can’t perform that action at this time.
0 commit comments