Changing Harlowe to Sugarcube: click macro

Please specify version and format if asking for help, or apply optional tags above:
Twine Version: 2.3.8
Story Format: Sugarcube
Probably a really simple question, but I can’t work it out. I wrote something in Harlowe (below), and I’m trying to switch to Sugarcube. I know the click macro doesn’t exist in sugarcube, and there are a couple of suggestions in the documentation of what to use, but I can’t make any of them work. I don’t want to link to a new passage, just set a different variable depending on what word is clicked

Do you decide to wear your hat?
Yes
No
(click: “Yes”)[(set:$hat to ‘wear’)]
(click: “No”)[(set:$hat to ‘notwear’)]

Many thanks! I’m very new to this

You want to look at the <<link>> macro. For example:

Do you decide to wear your hat?
<<link "Yes">><<set $hat to 'wear'>><</link>>
<<link "No">><<set $hat to 'notwear'>><</link>>

Thanks! I got confused with links linking to new passages