How to use mouse on event with html button in PlayCanvas style?

Currently I have with addEventListener

btnDrive.addEventListener('click', () => {
but I see there is a way to to in this way, this.onDrive, this);

how to ‘bind’ with html button?

The way you are currently doing it is the ‘right’ of doing it as you hooking up to a HTML element.

1 Like