You can always create a new selector, one that works *almost*
as :contains does. The issue in your case (as I understand it) is
that :contains does a global search, so text that is not at the
beginning is still matched. It sounds like what you need is a :begins-
with filter.
Extending the filter
Where would I put the jQuery.expr code you created? Would love to
test.
And thanks in advance!
On Sep 3, 10:32 am, KeeganWatkins keeganwatk...@gmail.com wrote:
You can always create a new selector, one that works *almost*
as :contains does. The issue in your case (as I understand it) is
jQuery.expr[ : ][begins-with] = function(elem, index,
match) {
return ( new RegExp(^ + match[3]).test( elem.textContent
||
elem.innerText || ));
}
$(p:begins-with('\“'), h1:begins-with('\“'), h2:begins-with
3 matches
Mail list logo