Welcome to StackOverflow.
You need to use the string interpolation symbols ( ` ) around that string in order to do the ${...} substitution properly:
`audio[data-key="${e.keyCode}"]`
Otherwise the selector query is receiving the literal string which is trying to match elements with data-key equal to "${e.keyCode}"
. This is called a "template literal" and you can read more about the nuances here.
Alternatively, you could do this to avoid using a template literal and stick to standard quotes:
'audio[data-key="' + e.keyCode + '"]'
I have two candlestick graphs displaying on the same page. They occupy the same space, but one is hidden while the other is displayed, like so: <div class="box" id="box1"> <div class="...
I have two candlestick graphs displaying on the same page. They occupy the same space, but one is hidden while the other is displayed, like so: <div class="box" id="box1"> <div class="...
I have some Problem with this code. I will use this code instead of a polyfill. The code works using Firefox, Chrome, Opera and MS Edge but the Internet Explorer 11 is not responding. Can someone give ...
I have some Problem with this code. I will use this code instead of a polyfill. The code works using Firefox, Chrome, Opera and MS Edge but the Internet Explorer 11 is not responding. Can someone give ...
I need to have something similar to Facebook Messenger's chat heads in my app, basically a bubble that can be viewed over other apps. I can't find anything online on this topic besides this question. ...
I need to have something similar to Facebook Messenger's chat heads in my app, basically a bubble that can be viewed over other apps. I can't find anything online on this topic besides this question. ...
There will be for sure a duplicate for this question, but I'd like to have an answer for this specific piece of code. I have this function: var somevar = ""; some.method({ ... }).then(function (...
There will be for sure a duplicate for this question, but I'd like to have an answer for this specific piece of code. I have this function: var somevar = ""; some.method({ ... }).then(function (...