UNPKG

pjax

Version:

Easily enable fast AJAX navigation on any website (using pushState + XHR)

13 lines (11 loc) 313 B
module.exports = function contains(doc, selectors, el) { for (var i = 0; i < selectors.length; i++) { var selectedEls = doc.querySelectorAll(selectors[i]); for (var j = 0; j < selectedEls.length; j++) { if (selectedEls[j].contains(el)) { return true; } } } return false; };