Content deleted Content added
Mike Dillon (talk | contribs) m add elements: "h1", "h2", "h3", "h4", "h5" |
Mike Dillon (talk | contribs) enhanced attribute support: skip null attribute values; invoke functions passed as attribute values |
||
Line 12:
var attrs = arguments[0];
for (var
// Skip null values
if (attrValue == null) {
continue;
}
// Invoke functions and use their result as the value
if (typeof(attrValue) == 'function') {
attrValue = attrValue();
}
// Set the attribute
elem.setAttribute(attrName, attrValue);
}
firstChild = 1;
|