Good day. Please tell me ways to block the effect of this function here:
$('#sendcustomcake').click(function(){ createCustomBooking(); }); $('document').ready(function() { $('#sendcustomcake').on('click', function() { $('.refield').each(function() { if ($(this).val() != '') { // Если поле не пустое удаляем класс-указание $(this).removeClass('empty_field'); } else { // Если поле пустое добавляем класс-указание $(this).addClass('empty_field'); document.getElementById('#sendcustomcake').removeEventListener('click', createCustomBooking); } }); I try to do this with removeEventListener, but this does not help.
off- unsubscribe handler - Grundyoffmethod is responsible for this - Grundydocument.getElementById('#sendcustomcake').off('click', createCustomBooking); }document.getElementById('#sendcustomcake').off('click', createCustomBooking); }Like this? - Webdev96