Toggle class on menu but also remove class

Toggle class on menu but also remove class

hi guys - i need some help with something relatively simple.

i have a bunch of menu items
  • item 1 
  • item 2
  • item 3
  • item 4
when i click any of the items i need to toggle a class 'open' indivually for each item but if i click on another item example item 3 i need to remove the class open.

this is how my code looks so far - i am able to toggle the class but it doesn't get removed when click on the different items.

  1. $('#Menu1 .DropDownInner').on('click', function(e){    
  2.     e.preventDefault();
  3.     
  4.     $('li.dropdown').not(
  5.         $(this).parent().toggleClass('open').parent().removeClass('open')
  6.     );

  7. });
any help would be appreciated.
many thanks