I try to make custom links and then connect the AJAX to them. There is a standard script that works from the part, but if you click on link1 and back on All, then it will not work even though All no longer has a class active how can you solve this?
<li class=active><a href='#'>All</a> <li ><a href='#'>link1</a> <li ><a href='#'>link2</a> <li ><a href='#'>link3</a> jQuery('.tabs ul li[class="active"] a').on('click', function(event) { event.preventDefault(); }); jQuery('.tabs ul li[class!="active"] a').on('click', function(event) { event.preventDefault(); jQuery('.tabs ul li[class="active"]').removeClass( "active" ); jQuery(this).parent('li').addClass('active'); doajax(); });