I'm trying to make stress boxes that change when you click on them. Right now, both symbols are displaying and the value isn't changing from 0. Here's my code: HTML: <button class="stress" name="act_stress1" ><span class = "pic1">k</span><span class="pic1_check">*</span></button> <input type="hidden" class="toggle1" value="0" name="attr_stress1_flag" /> <button class="stress" name="act_stress2" ><span class = "pic2">k</span><span class="pic2_check">*</span></button> <input type="hidden" class="toggle2" value="0" name="attr_stress2_flag" /> <button class="stress" name="act_stress3" ><span class = "pic3">k</span><span class="pic3_check">*</span></button> <input type="hidden" class="toggle3" value="0" name="attr_stress3_flag" /> <button class="stress" name="act_stress4" ><span class = "pic4">k</span><span class="pic4_check">*</span></button> <input type="hidden" class="toggle4" value="0" name="attr_stress4_flag" /> <button class="stress" name="act_stress5" ><span class = "pic5">k</span><span class="pic5_check">*</span></button> <input type="hidden" class="toggle5" value="0" name="attr_stress5_flag" /> <button class="stress" name="act_stress6" ><span class = "pic6">k</span><span class="pic6_check">*</span></button> <input type="hidden" class="toggle6" value="0" name="attr_stress6_flag" /> <button class="stress" name="act_stress7" ><span class = "pic7">k</span><span class="pic7_check">*</span></button> <input type="hidden" class="toggle7" value="0" name="attr_stress7_flag" /> <button class="stress" name="act_stress8" ><span class = "pic8">k</span><span class="pic8_check">*</span></button> <input type="hidden" class="toggle8" value="0" name="attr_stress8_flag" /> <button class="stress" name="act_stress9" ><span class = "pic9">k</span><span class="pic9_check">*</span></button> <input type="hidden" class="toggle9" value="0" name="attr_stress9_flag" /> <button class="stress" name="act_stress10" ><span class = "pic10">k</span><span class="pic10_check">*</span></button> <input type="hidden" class="toggle10" value="0" name="attr_stress10_flag" /> Javascript: const toggleList = ["stress1", "stress2","stress3","stress4","stress5","stress6","stress7","stress8","stress9","stress10"]; togglelist.forEach(toggle => { on(`clicked:${toggle}`, function() { const flag = `${toggle}_flag`; getAttrs([flag], function(v) { setAttrs({ [flag]: v[flag] !== "1" ? "1" : "0" }); }); }); }); CSS: .charsheet .toggle1[value=1] ~ .pic1, .charsheet .toggle2[value=1] ~ .pic2, .charsheet .toggle3[value=1] ~ .pic3, .charsheet .toggle4[value=1] ~ .pic4. .charsheet .toggle5[value=1] ~ .pic5, .charsheet .toggle6[value=1] ~ .pic6, .charsheet .toggle7[value=1] ~ .pic7, .charsheet .toggle8[value=1] ~ .pic8, .charsheet .toggle9[value=1] ~ .pic9, .charsheet .toggle10[value=1] ~ .pic10{ display:none; } .charsheet .toggle1[value=0] ~ .pic1_checked, .charsheet .toggle2[value=0] ~ .pic2_checked, .charsheet .toggle3[value=0] ~ .pic3_checked, .charsheet .toggle4[value=0] ~ .pic4_checked, .charsheet .toggle5[value=0] ~ .pic5_checked, .charsheet .toggle6[value=0] ~ .pic6_checked, .charsheet .toggle7[value=0] ~ .pic7_checked, .charsheet .toggle8[value=0] ~ .pic8_checked, .charsheet .toggle9[value=0] ~ .pic9_checked, .charsheet .toggle10[value=0] ~ .pic10_checked{ display:none; } Any ideas?