Element.opDispatch

string opDispatch(string name)(string v = null) if(isConvenientAttribute(name)) @property

Provides easy access to common HTML attributes, object style.

auto element = Element.make("a");
a.href = "cool.html"; // this is the same as a.setAttribute("href", "cool.html");
string where = a.href; // same as a.getAttribute("href");

string opDispatch(string name)(string v = null) if(!isConvenientAttribute(name)) @property

Old access to attributes. Use [attrs] instead.

DEPRECATED: generally open opDispatch caused a lot of unforeseen trouble with compile time duck typing and UFCS extensions. so I want to remove it. A small whitelist of attributes is still allowed, but others are not.

Instead, use element.attrs.attribute, element.attrs["attribute"], or element.getAttribute("attribute")/element.setAttribute("attribute").