Last active
February 15, 2021 17:35
-
-
Save ohiosveryown/885d33bf00c464c8480000a79c9bcd89 to your computer and use it in GitHub Desktop.
Target / Get multiple elements
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
<ul class="parent"> | |
<li class="children"></li> | |
<li class="children"></li> | |
<li class="children"></li> | |
</ul> | |
*/ | |
const parent = document.querySelector('.parent') | |
const children = document.querySelectorAll('.children') | |
parent.addEventListener('mousedown', () => { | |
children.forEach ((children) => { | |
children.style.transform = 'scale(.95)' | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment