<a id="myBtn"><img src="img/low1.png"></a>
<div id="myModal" class="modal">
<div class="modal-content">
<span class="close"></span>
<p>text</p>
</div>
</div>
var modal = document.getElementById('myModal');
var btn = document.getElementById("myBtn");
var span = document.getElementsByClassName("close")[0];
btn.onclick = function () {
modal.style.display = "block";
}
span.onclick = function () {
modal.style.display = "none";
}
window.onclick = function(event) {
if (event.target == modal) {
modal.style.display = "none";
}
}
<a id="myBtn"><img src="img/low1.png"></a>
<div id="YouBtnl" class="modal">
<div id="modez" class="mod"
<div class="contmod">
<span class="close"></span>
<p>text</p>
</div>
</div>
var modez = document.getElementById('modezl');
var YouBtn = document.getElementById("YouBtn");
var span = document.getElementsByClassName("close")[0];
btn.onclick = function () {
modal.style.display = "block";
}
span.onclick = function () {
modal.style.display = "none";
}
window.onclick = function(event) {
if (event.target == modal) {
modal.style.display = "none";
}
}