Code:
$(document).ready(function(){
var currentsong;
$("#play-button").click(function(){
if (currentsong == 1) {
$("#audio-1")[0].play();
}
else if (currentsong == 2) {
$("#audio-2")[0].play();
}
else if (currentsong == 3) {
$("#audio-3")[0].play();
}
else if (currentsong == 4) {
$("#audio-4")[0].play();
}
else {
$("#audio-5")[0].play();
}
})
$("#pause-button").click(function(){
if (currentsong == 1) {
$("#audio-1")[0].pause();
}
else if (currentsong == 2) {
$("#audio-2")[0].pause();
}
else if (currentsong == 3) {
$("#audio-3")[0].pause();
}
else if (currentsong == 4) {
$("#audio-4")[0].pause();
}
else {
$("#audio-5")[0].pause();
}
})
$("#next-button").click(function(){
if (currentsong < 5) {
currentsong = currentsong + 1;
}
else if (currentsong == 5) {
currentsong = 1;
}
})
})
this is the entire file currently.
I edited the comparison operators from = to ==, but now the buttons no longer function.
Thanks,