Thanks for the feedback. i have tried changing this to btn and still doesn't work. What I mean is that I have 3 div elements and those elements have a <button class='play'> each. And whenever a button is clicked it should indicate on the parent element which is the div that the button is playing a audio. And when i click on the second button from div number two, the data-status='isPlaying' should be on the second div and not the first one anymore
Thanks for the feedback. i have tried changing
this
tobtn
and still doesn't work. What I mean is that I have 3div
elements and those elements have a<button class='play'>
each. And whenever a button is clicked it should indicate on the parent element which is thediv
that the button is playing a audio. And when i click on the secondbutton
fromdiv
number two, thedata-status='isPlaying'
should be on the seconddiv
and not the first one anymoreAlrighty, this is my markup,
And this is my script
Thank you so much...instead of using
button.parentNode.playStatus
i used it as a dataset so I can retrieve it later on...Thanks