Properties > Targets

DOM

The dom updater is used to manipulate the DOM of the matched element(s):

...
dom: (targetEl, useValue, el) => {
// `targetEl` is a reference to the matched element
// `useValue` is the property value, or the computed `use` value
// `el` is a reference to the component itself

targetEl.innerHTML = '';
const span = document.createElement('span');
span.textContent = useValue;
targetEl.append(span);
}
...

A common use case for the dom selector is to repeat an array of DOM elements inside a container. See the repeat helper for information on how this can be achieved in Wafer components.

Next: Use Previous: Attribute