Skip to content

Commit

Permalink
Update script.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Ash-KODES authored Apr 26, 2022
1 parent 1434298 commit 7ddc949
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ Array.from(document.getElementsByClassName("songItemPlay")).forEach(
element.addEventListener("click", (e) => {
makeAllPlays();
songIndex = parseInt(e.target.id);
//parseInt-->take int and return integer.
e.target.classList.remove("fa-play-circle");
e.target.classList.add("fa-pause-circle");
audioElement.src = `songs/${songIndex + 1}.mp3`;
Expand Down

0 comments on commit 7ddc949

Please sign in to comment.