Create an XML/HTML attribute.
Create an XML/HTML attribute.
Represents an XML/HTML attribute. It can be easily created with the attr function.
import elemi.xml; // Create new attributes with `attr` auto a = attr("key") = "value"; assert(a == `key="value"`); // And pass them to elements assert(elem!"div"(a) == `<div key="value"></div>`); assert(elem!"div"( attr("key") = "value", attr("class") = "one two three", ) == `<div key="value" class="one two three"></div>`);
Holds the Attribute type which can be passed to elem to add attributes to XML and HTML elements.