MCPcopy
hub / github.com/microsoft/SandDance / domChild

Function domChild

docs/app/js/sanddance-app.js:123210–123218  ·  view source on GitHub ↗
(el, index, tag, ns)

Source from the content-addressed store, hash-verified

123208} // retrieve child element at given index
123209// create & insert if doesn't exist or if tags do not match
123210function domChild(el, index, tag, ns) {
123211 var a = el.childNodes[index], b17;
123212 if (!a || a.tagName.toLowerCase() !== tag.toLowerCase()) {
123213 b17 = a || null;
123214 a = domCreate(el.ownerDocument, tag, ns);
123215 el.insertBefore(a, b17);
123216 }
123217 return a;
123218} // remove all child elements at or above the given index
123219function domClear(el, index) {
123220 var nodes = el.childNodes, curr = nodes.length;
123221 while(curr > index)el.removeChild(nodes[--curr]);

Callers 5

initializeFunction · 0.70
svgFunction · 0.70
defsFunction · 0.70
updateGradientFunction · 0.70
updateClippingFunction · 0.70

Calls 1

domCreateFunction · 0.70

Tested by

no test coverage detected