Preparing search index...

    Function appendTo

    • Appends an SVG string to a DOM element, replacing any existing content.

      Parameters

      • container: HTMLElement

        The DOM element where the SVG will be appended.

      • svgString: string

        The SVG markup as a string to be inserted.

      Returns void

      This function does not return a value.

      May throw if the SVG string is malformed and cannot be parsed.

      import EnergyLabel, { appendTo } from 'energy-label'

      const element = document.getElementById('energy-label')

      const label = new EnergyLabel('arrow', { efficiencyRating: 'A' })
      const svgString = label.toString()

      appendTo(element, svgString)