From 8eac54d49f5b02b92e5cbea13266ab16b23c431d Mon Sep 17 00:00:00 2001 From: Hyunje Alex Jun Date: Tue, 18 Aug 2015 03:20:55 +0900 Subject: [PATCH] Add a queryChildren method to dom.js --- src/js/lib/dom.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/js/lib/dom.js b/src/js/lib/dom.js index 451716e..a2adf3f 100644 --- a/src/js/lib/dom.js +++ b/src/js/lib/dom.js @@ -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;