Procasti..nator: Chrome Extension Part 8

JavaScript Chrome Extensions
Transcript

English (Auto-generated)

Okay. So let's wrap things up by playing a sound when the start button is clicked. So let me go ahead and now um declare a function and we'll call this function play start music and and off, plea start music. And inside this function will set the audio source off the Dom music element to be equal to the start sound file that we have up here on the left side in our project folder. So we already have the start sound. And then we want to attach the play method to the audio element. And if you remember, the audio element is referenced by this variable called music online number five. And now that we've got our place start music function declared. We'll call this function from inside the click event handler which is attached to a start button. So we'll do it here and play start music function. Okay, so that's all for this cast in the next cast. Let's just try everything out.
87 Views 1 Likes 0 Comments

Let's wrap things up by playing a sound when the start button is clicked

Comment
Leave a comment (supports markdown format)