This is really confusing me. Everything runs smooth in Chrome and Safari, but I get an error in Firefox:
TypeError: currentButton is undefined
It lists the "index - currentButton" line as the source of the error. I'd love to know what I did wrong here! Hopefully this is enough code to track down the problem:
document.getElementById('buttons').addEventListener('click', function(e) {
var currentButton = e.srcElement,
index = currentButton.getAttribute('data-index');