Appends an SVG string to a DOM element, replacing any existing content.
The DOM element where the SVG will be appended.
The SVG markup as a string to be inserted.
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) Copy
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)
Appends an SVG string to a DOM element, replacing any existing content.