Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- document.addEventListener("DOMContentLoaded", function() {
- document.querySelectorAll('.photo')
- var htmlElement = document.getElementsByClassName("photo");
- console.log(htmlElement);
- /*for(var i = 0; i < htmlElement.length; i++) {
- htmlElement[i].classList.toggle("raudonasTekastas");
- }*/
- for(var i = 0; i < htmlElement.length; i++) {
- htmlElement[i].addEventListener("click", function(){
- this.classList.add("raudonasTekastas");
- console.log(this);
- });
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment