We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Typescript button onclick event is not triggering

import {Button} from '@syncfusion/ej2-buttons';

class ProductExtraPopups {

private editBrandBtn: Button;

constructor() {


private setupEditBrandPopup() {
this.editBrandBtn = new Button({
isPrimary: true,
content: "Add New",


this.editBrandBtn.element.onclick = (): void => {
console.log('It is working !');

const extraPopups = new ProductExtraPopups();

html file

<button id="add-new-brand" type="button"></button>


Console message is not showing in the browser console. Any suggestions would be grateful.

1 Reply

YA YuvanShankar Arunagiri Syncfusion Team October 10, 2022 12:50 AM

Hi Shanaka,

We unable to replicate the issue in our end. For your reference we prepared the sample.

Sample link: https://stackblitz.com/edit/csfnrl?file=index.ts

If you are still facing issue, please share the below details.

  • Share the issue reproducible sample or replicate the issue in our sample.

Please provide the above requested information, based on that we will check and provide you a better solution quickly.


YuvanShankar A

Live Chat Icon For mobile
Up arrow icon