Skip to content

DomElementInfo.attr?

DomElementInfo › attr?

Official

Type: Record<string, boolean | null | number | string>

HTML attributes to be added.

Example:

createEl('p', { attr: { id: 'foo', 'data-bar': 'baz' } });