Commit 2f8d51ce authored by Julien Cigar's avatar Julien Cigar
Browse files
parents 633793d9 7442ab04
......@@ -492,6 +492,21 @@
})(name, src);
}
/* Yeti.DOM.firstElementTag
* Returns a reference to the first child node of that element which is of
* nodeType 1 and of tag <tag>.
*/
Yeti.DOM.firstElementTag = function(elem, tag) {
var tag = tag.toUpperCase();
for (var i=0, _len=elem.childNodes.length; i<_len; i++) {
var child = elem.childNodes[i];
if (child.nodeType === 1 && child.nodeName.toUpperCase() == tag) {
return child;
}
}
return null;
}
/* Yeti.DOM.removeNodes
* Removes all child nodes from an element.
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment