Help with an Audio Source selector

I’ve got this audio source on my page for a in browser keyboard tester and the below audio plays when a key is pressed.

<audio id="myAudio"> <source src="click.wav"> </audio>

<script>var x = document.getElementById("myAudio"); function playAudio() { [](; } &#x200B;

I tried to make a drop down list to change the audio sound but cant seem to get it to work any help would be grateful :slight_smile:

<select id="selection"> <option value="">(None)</option> <option value="click.wav">Click</option> <option value="quack.mp3">Quack</option> </select>

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.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

  1. Explain what you think[](; } &#x200B; does.

  2. I do not see any code that calls the playAudio function you created.

I suggest reading this MDN article on the audio element. It has examples of proper syntax.