attributes(contentsOf:when:)

Adds the specified attributes to the element.

Html+Attributes.swift:112
func attributes(contentsOf attributes: [HTMLAttribute<Tag>], when condition: Bool = true) -> _AttributedElement<Self>

Parameters

attributes

The attributes to add to the element as an array.

condition

If set to false, the attributes will not be added.

Returns

A new element with the specified attributes added.