I want to have a button that closes cells with a specific tag. The following code does what I want:
SetOptions[#, CellOpen -> False] & /@ Cells[CellStyle -> "Section" , CellTags -> "A" ]
But when I try to make a Button
(or Buttonbar
) like
Button["B",
SetOptions[#, CellOpen -> False] & /@ Cells[CellStyle -> "Section" , CellTags -> "A" ]
]
nothing happens when I click the Button
.
What am I missing?