The first added item will open the dropdown menu when user clicks on three bullits, The problem begins when you add more then one item to that list. Not all the dropdown meny will be shown in this case and it is right that only one dropdown will show each time (accordion).
function toggleOptionButton() {
var itemClass = this.nextElementSibling.className;
console.log(itemClass);
for(var i = 0; i < option.length; i++) {
option[i].className = 'option closeOption';
}
if(itemClass === 'option closeOption') {
this.nextElementSibling.className = 'option openOption';
console.log(itemClass);
}
}
In order to give you a clear picture of the entire code —> https://codepen.io/chichichi/pen/rpYNqe?editors=0111
You should look between line 48 and 58.