# ui.Button.onClick

<br />

Registers a callback that's fired when the button is clicked.

<br />

Returns an ID which can be passed to unlisten() to unregister the callback.

| Usage | Returns |
|---|---|
| `Button.onClick(callback)` | String |

| Argument | Type | Details |
|---|---|---|
| this: `ui.button` | ui.Button | The ui.Button instance. |
| `callback` | Function | The callback to fire when the button is clicked. The callback is passed the button widget. |