Last active
October 16, 2019 06:55
-
-
Save AirStair/194f47b0c71acd72ce50007f66362a39 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function queryText(selector, text) { | |
try { | |
var elements = document.querySelectorAll(selector); | |
return Array.prototype.filter.call(elements, function (element) { | |
return RegExp(text).test(element.textContent); | |
}); | |
} catch (e) { | |
console.log(e); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment