Returns a new button with the given level and function as an onclick event handler.

document.body.appendChild(mxUtils.button('Test', (evt)=>
{
alert('Hello, World!');
}));
  • Parameters

    • label: string

      String that represents the label of the button.

    • funct: ((evt: MouseEvent) => void)

      Function to be called if the button is pressed.

        • (evt): void
        • Parameters

          • evt: MouseEvent

          Returns void

    • doc: null | Document = null

      Optional document to be used for creating the button. Default is the current document.

    Returns HTMLButtonElement