Add a queryChildren method to dom.js

This commit is contained in:
Hyunje Alex Jun 2015-08-18 03:20:55 +09:00
parent ed4e335978
commit 8eac54d49f

View File

@ -78,4 +78,10 @@ DOM.remove = function (element) {
} }
}; };
DOM.queryChildren = function (element, selector) {
return Array.prototype.filter.call(element.childNodes, function (child) {
return DOM.matches(child, selector);
});
};
module.exports = DOM; module.exports = DOM;