It looks like you have used the variable buttonlist in that second set, does the first list also use it? If so, that's your problem - you cant set a variable with the same name twice with const. You can use just one sheet worker for both sets, if you did this: const buttonlist = { x : "sheetTab" , y : "sheetTab" , z : "sheetTab" , one : "sheetTabs" , two : " sheetTabs " , three : " sheetTabs " }; buttonlist . forEach ( button => { on ( `clicked: ${ button } ` , function () { setAttrs ({ [ tabslist [ button ]]: button }); }); }); I'd recommend changing the names to be more descriptive, and make it easier to expand to more tabs on other pages. Lets say you had three pages, named 'character', 'minions'. and 'config'. On the character tab, you had three tabs, for 'stats', 'powers', and 'weapons'. I'd set that up like this: < div > < button type = "action" name = "act_character" > Character </ button > < button type = "action" name = "act_minions" > Minions </ button > < button type = "action" name = "act_config" > Config </ button > </ div > < input type = 'hidden' class = 'tabstoggle' name = 'attr_sheetTab' value = 'character' /> < div class = "character" > < button type = "action" name = "act_stats" > Stats </ button > < button type = "action" name = "act_powers" > Powers </ button > < button type = "action" name = "act_weapons" > Weapons </ button > < span name = "attr_characterTab" ></ span > < input type = 'hidden' class = 'sheet-tabstoggle' name = 'attr_characterTab' value = 'stats' /> < div class = "stats" > stats </ div > < div class = "powers" > powers </ div > < div class = "weapons" > weapons </ div > </ div > < div class = "minions" > minions </ div > < div class = "config" > config </ div > Notice I've used the same classname for the input inside the character tab, but I've changed its name. Then I need a sheet worker. const tabslist = { character : "sheetTab" , minions : "sheetTab" , config : "sheetTab" , stats : "characterTab" , powers : "characterTab" , weapons : "characterTab" }; Object.keys(tabslist). forEach ( button => { on ( `clicked: ${ button } ` , function () { setAttrs ({ [ tabslist [ button ]]: button }); }); }); Notice I can easily expand this for new tabs sets, but just adding extra lines to the tablist variable. And most importantly, I can look at the code and see what it is actually doing. Finally I need some CSS .sheet-character , .sheet-minions , .sheet-config , .sheet-stats , .sheet-powers , .sheet-weapons { display : none ; } .sheet-tabstoggle [ value = "character" ] ~ div.sheet-character , .sheet-tabstoggle [ value = "minions" ] ~ div.sheet-minions , .sheet-tabstoggle [ value = "config" ] ~ div.sheet-config , .sheet-tabstoggle [ value = "stats" ] ~ div.sheet-stats , .sheet-tabstoggle [ value = "powers" ] ~ div.sheet-powers , .sheet-tabstoggle [ value = "weapons" ] ~ div.sheet-weapons { display : block ; } Here I can just group all the rules together for convenience. CSS doesn't care where they are on the sheet. By using the same class name (tabsToggle), I have made copy and paste easier, and using actual descriptive names for the sections I've made it very easy to remember what part of the sheet is being affected. Note that you can use the same tabsToggle class name because the ~ CSS rule we are using to display/hide sections must be within the same container and at the same level. So the tabstoggle on the page tabs is at a different place to the one on the characterstab, so they don't affect each other.