Answers for "javascript change more than one images"

0

javascript change more than one images

<HTML>
<a onclick="Function()" target="_blank">Click here!</a>
<img class="image" src="../images/Test.jpeg" alt="book" />
<img class="image" src="../images/Test.jpeg" alt="book" />
  
</HTML>

<script>
  function Function() {
    var object = document.getElementsByClassName("image");
    for (var i = 0; i < object.length; i+= 1){
    object[i].src = '../images/Test2.jpeg';}
}
</script
Posted by: Guest on June-06-2021

Code answers related to "javascript change more than one images"

Code answers related to "Javascript"

Browse Popular Code Answers by Language