For example, each button currently has code like this in the html file:
<div class='btn f seafood' tabindex='1'>seafood</div>
<audio id='seafood' controls style='display:none'><source src='sounds/seafood.mp3' type='audio/mpeg'> Your browser does not support the audio element.</audio>
And this in the talker.js file:
if ($(':focus').hasClass('seafood')) {document.getElementById('seafood').play()}
Is there a way to streamline this so the repetitive code is eliminated and there's just a list of words referenced?
For example, each button currently has code like this in the html file:
<div class='btn f seafood' tabindex='1'>seafood</div><audio id='seafood' controls style='display:none'><source src='sounds/seafood.mp3' type='audio/mpeg'> Your browser does not support the audio element.</audio>And this in the talker.js file:
if ($(':focus').hasClass('seafood')) {document.getElementById('seafood').play()}Is there a way to streamline this so the repetitive code is eliminated and there's just a list of words referenced?