I want to fire a function name shake dots when clicked in audio apparently it does not fire here is the code
<div class="lyric-word">
<span class="sho">.</span>
<span class="sho">.</span>
<span class="sho">.</span>
<span class="sho">.</span>
<span class="sho">.</span>
<span class="sho">.</span>
</div>
<div class="btm">
<audio id="thisaudio" onclick="shakeDots()" src="https://pagalworld.com.mx/wp-content/uploads/2023/02/Until-I-Found-You.mp3"
controls controlsList="nodownload noplaybackrate"></audio>
</div>
JS
function shakeDots() {
const $click= document.querySelectorALL('.shok');
$click.classList.add('shak');
console,log("Clicked")
}
Thanks
$clickvariable and add to the classList of each element. Also, because spans are inline elements they might not be easily clickable.querySelectorALLis not a function. JavaScript is case-sensitive. This is a good time to start looking at your browser's development tools, where you can see error messages on the console. (Edit: You have another typo here:console,log)