So I can get the events to happen separately but I need them to happen at the same time. Here's the code I am using:
<div class="red">
<button type="button" onclick="audio(); story();"><img src="squeak.png" alt="s" class="squeak">
</button>
<audio src="Squeaky-toy-sound-effect.mp3" id="mySqueak"></audio>
</div>
<script>
function audio() {
document.getElementById("mySqueak").play();
}
function story() {
document.location.href="story.html";
}
</script>
Basically I need the image to squeak and go to the page story.html.
<div class="red">
<button type="button" onclick="audio(); story();"><img src="squeak.png" alt="s" class="squeak">
</button>
<audio src="Squeaky-toy-sound-effect.mp3" id="mySqueak"></audio>
</div>
<script>
function audio() {
document.getElementById("mySqueak").play();
}
function story() {
document.location.href="story.html";
}
</script>
Basically I need the image to squeak and go to the page story.html.