'Hi all, add class on multiple button on each click

All, I got the requirement that on each button click, a class should be added in the dropdown menu, and on the button and outside click, the cancel button should be removed.But in the dropdown it shouldn't be removed. I am new to JavaScript, so any help would be greatly appreciated.

`https://codepen.io/busniessaman/pen/MWQKKOa`


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source