UI Switch Button

UI Switch Button

Hi,
I was discovered this nice button, but I cannot understand, how can I can check state of button, without using FORM tag. Please show me example, how it works.

Here is what I try. Thanks for hints!
Jerry