Open and Close Groups from an html button

One question, how can I open and close a group, from an HTML button, what properties should my groups have to make this possible?
image

Have each Button’s onclick handler find the specific Group instance and then call either the appropriate command on it – CommandHandler | GoJS API or CommandHandler | GoJS API

How can I indicate in the onClick what element I want to open or close?

You have to find the particular instance of Group that you want to open or close. I don’t know how your model data is defined, but I would guess that calling Diagram.findNodeForKey is what you would want to call. Remember that the method may return null, just as other “find…” methods on the Diagram class, may return null or the empty collection.