Created
May 27, 2016 03:23
-
-
Save darcyclarke/06953142c44d04910cc3ac7f3deca1cc to your computer and use it in GitHub Desktop.
A jQuery filter selector for ":missing" (ie. opposite of ":contains")
This file contains hidden or 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
/*! | |
* | |
* jQuery :missing Plugin | |
* http://darcyclarke.me/articles/development/find-elements-that-dont-contain-a-string/ | |
* | |
* Copyright 2016, Darcy Clarke | |
* Do what you want license | |
* | |
*/ | |
jQuery.expr[':'].missing = function(elem, index, match) { | |
return (elem.textContent || elem.innerText || Sizzle.getText([elem]) || '').indexOf(match[3]) == -1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment