i want to hide images with the same class in Javascipt. i have 3 images to hide but i don't know how can i do it. I tried it but did't work:
html
<img src="img1.png" class="tool">
<img src="img2.png" class="tool">
<img src="img3.png" class="tool">
js
const toolHide = document.getElementsByClassName("tool");
for (i=0; i < toolHide.length; i++) {
if (toolHide.style.visibility === "visible") {
toolHide.style.visibility = "hidden";
}
}
please help!