You can use its interface HTMLButtonElement
that inherits from its parent HTMLElement
!
This way you will be able to have auto-completion...
<button (click)="toggle($event)" class="someclass otherClass" id="btn1"></button>
toggle(event: MouseEvent) {
const button = event.target as HTMLButtonElement;
console.log(button.id);
console.log(button.className);
}
To see all list of HTMLElement from the World Wide Web Consortium (W3C) documentation