What do you want to invoke when the checkbox object changes state? If you’re programming it
in a non-reusable way, you can hard-code the action directly into the onclick event:
if (state==checked) do X; if (state==grayed_out) do y; etc. If you’re programming it
as a reusable component, you need a more flexible solution.