Deconstructing A Dynamic Quiz (Part III)
THE JAVASCRIPT (CONTINUED) $(‘#next’).on(‘click’, function(event) { event.preventDefault(); if($(“#quiz”).is(‘:animated’)) { return false; } choose(); if(isNaN(selections[questionCounter])) { alert(‘Please make a selection!’); } else { questionCounter++; displayNext(); } }); A click handler is created for the ‘next’ button. When clicked, a function is ran. The first thing it does is calls the preventDefault() method, which stops the default…