addEventListener test

This commit is contained in:
Olga Konstantinova 2023-07-08 15:40:43 +03:00
parent 2f35200625
commit 5b17bb0a01

View File

@ -1,8 +1,5 @@
<html>
<style>
.wishes {
display: flex;
}
.image-block img {
width: 300px;
@ -22,7 +19,7 @@
}
.image-block .image:has(input:checked) img {
.image-block .image:has(img.viewed) img {
position: absolute;
top: 150px;
left: 300px;
@ -64,6 +61,7 @@
</ul>
</div>
</div>
<input type="file" id="input" multiple>
<div class="image-block">
@ -99,5 +97,11 @@
</label>
</div>
<script>
const images = document.querySelectorAll("div.image-block img");
images.addEventListener();
images.addEventListener('click', function(){img.classList.toggle('view')};);
</script>
</body>
</html>