How to fix clicking dont interfere one with another???

How to fix clicking dont interfere one with another???

then i move move navigation style by clicking button applied the function (removing class and adding class).

Link: https://codepen.io/psairidas/pen/YxOrwX
move mob2 style > mob1, from function mob22 appears on mob1 style,

I Fixed by using :
      nav.find("ul").removeAttr('class');
      nav.find("li").removeAttr('class');
      nav.find("a").removeAttr('class');
      nav.find("ul").removeAttr('style');
      nav.find("li").removeAttr('style');
      nav.find("a").removeAttr('style');
I dont know i can this like this?!
But maybe another way target all nav!