MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / createNode

Function createNode

lib/web/lazyload/lazyload.js:72–82  ·  view source on GitHub ↗

Creates and returns an HTML element with the specified name and attributes. @method createNode @param {String} name element name @param {Object} attrs name/value mapping of element attributes @return {HTMLElement} @private

(name, attrs)

Source from the content-addressed store, hash-verified

70 @private
71 */
72 function createNode(name, attrs) {
73 var node = doc.createElement(name), attr;
74
75 for (attr in attrs) {
76 if (attrs.hasOwnProperty(attr)) {
77 node.setAttribute(attr, attrs[attr]);
78 }
79 }
80
81 return node;
82 }
83
84 /**
85 Called when the current pending resource of the specified type has finished

Callers 1

loadFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected