jeudi 21 mai 2020

How to exclude element inside div from being affected by the div function?

I want to exclude the #someButtonHere from being affected by #AllContents onclick function. I try this code, but it doesn't work.
Notes: #someButtonHere is of course inside the #AllContents div, but everything need to be affected by the function, except someButton itself.

$(function() {
    $('#AllContents').filter(":not(#someButtonHere)").on('click', function() {
    $('#sidebar, #content').addClass('active');
    $('#sidebarCollapse').addClass('change');
 });
});



Aucun commentaire:

Enregistrer un commentaire