You could just check the length of the :contains string against
the .text() value in a .filter(function(){ ... })

On Oct 5, 9:20 am, Julijan Andjelic <julijan.andje...@gmail.com>
wrote:
> Is there a way (selector) that would allow me to select an element by
> exact mach of containing text.
>
> example:
>
> <div>
>     This is some text
> </div>
>
> <div>
>     This
> </div>
>
> Lets say i want to select only the second div
> $("div:contains('This')")...
> okay, it would select it, but...it would also select the first one.
> I could iterate through each div and check if the text is matching but
> that's kinda dirty way of doing this. Is there any selector which
> would allow me to do this without iteration?

Reply via email to