Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Can this be done neater? Reply To: Can this be done neater?

#245434
Shikkediel
Participant

You could combine a few things in any case. Preventing the default action won’t work if the event itself isn’t defined by the way.

$(document).on(‘click’, ‘#submit’, function(event) {
event.preventDefault();
$(‘#submit-wrapper, #submit-message’).hide();
$(‘#start-wrapper’).show();
$(‘#divId’).timer(‘remove’).html(’00:00′);
});

I’m assuming .timer is a method that belongs to some plugin…