Calculate the width of the text Example: getTextWidth('my text', node)

  • Parameters

    • text: string

      The text to calculate the width for

    • node: HTMLElement

      The HTML element

    Returns number