Skip to content

Commit 77f24f4

Browse files
Fixed a small bug
1 parent b25c068 commit 77f24f4

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

script.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@ import illustrationIcon from "url:./images/illustration-thank-you.svg";
77
// Select parent element
88
const parentElement = document.querySelector(".main-contents");
99

10-
const eachRating = document.querySelectorAll(".rating-number");
10+
let ratingNums = document.querySelector(".rating-numbers");
11+
let eachRating = document.querySelectorAll(".rating-number");
1112

1213
// Initialize selectedNum to null
1314
let selectedNum = null;
1415

15-
// Define ratingNums
16-
let ratingNums = document.querySelector(".rating-numbers");
17-
1816
// Add event listener to parent element
1917
parentElement.addEventListener("click", function (e) {
2018
// Get submit and back arrow buttons
@@ -111,9 +109,9 @@ const ratingState = function () {
111109
parentElement.innerHTML = markup;
112110
parentElement.style.opacity = "1";
113111

114-
// Add a new event listener for 'click' on ratingNums
115112
ratingNums = document.querySelector(".rating-numbers");
116113
ratingSelection();
114+
eachRating = document.querySelectorAll(".rating-number");
117115
}, 200);
118116
};
119117

0 commit comments

Comments
 (0)