skip to Main Content

Can WordPress & jQuery toggle click twice?

This is my code (toggle menu): $(function () { $('#menu li').click(function () { $('#menu li').removeClass("active"); $(this).toggleClass("active"); }); }) Works perfectly. But... If I click on one element and click on it again, the toggle does not close. I would like…

VIEW QUESTION

Why isn’t HTML input field data sent with jQuery to PHP working?

$(".save_form_email").on('click', function() { var pocet = $('#save__cena').val(); console.table(pocet); $.ajax({ url: '/modules/mod_custom_extended/tmpl/default.php', type: 'POST', data: { pocet: pocet }, contentType: 'application/x-www-form-urlencoded; charset=UTF-8', success: function(response) { console.table(response); }, error: function(jqXHR, textStatus, errorThrown) { console.log('AJAX request failed: ' + textStatus + ', '…

VIEW QUESTION
Back To Top
Search