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:begin
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 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
> that :contains does a
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 e
3 matches
Mail list logo