Build a Favorite Icon Toggler - Build a Favorite Icon Toggler

Tell us what’s happening:

Build a Favorite Icon Trigger Help 7 and 8 is not passing

Your code so far

<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <title></title>
    <link rel="stylesheet" href="styles.css">
</head>

<body>
<ul class="item-list">
    <li>Book<span class="favorite-icon">&#9825;</span></li>
    <li >Pen<span class="favorite-icon">&#9825;</span></li>
    <li >Ruler<span class="favorite-icon">&#9825;</span></li>
 
</ul>
</body>

</html>
/* file: styles.css */

/* file: script.js */
const spans = document.querySelectorAll(".favorite-icon");

spans.forEach((span) => {
  span.addEventListener("click", () => {
    if (span.classList.contains("filled")) {
      span.classList.remove("filled");
      span.innerHTML = "&#9825;"; 
    } else {
      span.classList.add("filled");
      span.innerHTML = "&#10084;";  
    }
  });
});

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36

Challenge Information:

Build a Favorite Icon Toggler - Build a Favorite Icon Toggler

have you tried your app? does clicking on the heart do something?

have you tried some debugging? does your code run?

I failed to link the files that was why It was failing. Thank you