Looping through Buttons to get their Src attribute if selected

I’m using vanilla javascript and currently trying to loop through each button. If the button if clicked, change some .style attributes and push the image.src into an array. I’m having trouble creating code that can selected multiple .src’s but not ALL of the srcs. Even if they aren’t clicked all the .src’s still show up on my console. I just am at a total blank.

for (let i = 0; i < favoriteBtn.length; i++) {
  let btn = favoriteBtn[i];
  let favoriteTheme = false;
  let imgCard = document.getElementsByClassName("card");

  btn.addEventListener("click", () => {
    for (let i = 0; i < Array.from(imgCard).length; i++) {
      let card = imgCard[i].src;

      if (favoriteTheme == false) {
        btn.style.backgroundColor = "red";
        btn.style.color = "white";
        favoriteTheme = true;
        // images.push(`'${card}'`);
      } else {
        btn.style.backgroundColor = "";
        btn.style.color = "";
        favoriteTheme = false;
      }
    }
  });
}