Changing attributes with click and querySelector not fully functioning

I’ve written this to change the background of a div that represents hours on a daily planner. The first instance (onclick) works but the others don’t. Do I need to give each .container their own id and their own function?

var changeStatus = document.querySelector("#changeStatus");
var container = document.querySelector(".container");

changeStatus.addEventListener("click", function () {
  container.setAttribute("class", "filled");
}

119 thoughts on “Changing attributes with click and querySelector not fully functioning”

  1. therapies cognitivo-comportementales pdf therapies kidney , therapies meaning pharmacie beaulieu horaires , [url=https://kit.co/meanri/buspar-pharmacie-luxembourg-acheter-buspar-10-mg-pas-cher#]Buspar vente libre[/url] pharmacie yenne [url=https://kit.co/kiyke/copegus-prix-sans-ordonnance-copegus-livraison-france#]Copegus vente libre[/url] , pharmacie ouverte fleurance therapie cognitivo comportementale valenciennes , therapie de couple cholet. pharmacie auchan tours nord therapie cognitivo comportementale wikipedia [url=https://kit.co/booksti/zyrtec-prix-sans-ordonnance-zyrtec-livraison-belgique#]Zyrtec vente libre[/url] , pharmacie petit auchan woippy. pharmacie victor hugo, medicaments infection urinaire pharmacie bourges ouverte lundi . pharmacie d’anjou angers, pharmacie clarines annecy le vieux pharmacie amiens sud burger king pharmacie en ligne suisse zur rose .

    Reply
  2. i need home loan with bad credit, i need an emergency loan now. i need a loan my credit is bad need loan now need a loan i need a loan help please, cash advance loans colorado springs, cash advance, cash advances, payday advance loans without bank account. Money lending to money management, financial institution .

    Reply

Leave a Comment