document.getElementById expects a text string (enclosed by ``, ’ ’ , or " "). Since we are also using a variable directly inside the text string (with the ${variable here}), we need to use a string literal using the backticks (`).
@megacartenterprises Did you figure it out? The code you shared does not contain backticks.
The first line should be: var song=document.getElementById(song-${userData?.currentSong?.id});
I just realized that the forum removes the backticks in code and that you should put sample code in triple backticks and end with triple backticks.
```
```
Or you can escape the backtick with \`.
so you get the output in the forum:
var song = document.getElementById(`song-${userData?.currentSong?.id}` );
But it actually looks like:
var song = document.getElementById(\`song-${userData?.currentSong?.id}\`);
Now to your question:
Your problem isn’t with the backticks. Have you used every instruction given to you in this step? The point of this step is to query the music player to find out which song is currently playing (the id of said song) and then to highlight it. So how do we query the page?
I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.