How do I select elements based on all their content in jQuery?

Posted by Kev on Stack Overflow See other posts from Stack Overflow or by Kev
Published on 2010-03-25T13:12:39Z Indexed on 2010/03/25 13:23 UTC
Read the original article Hit count: 315

Filed under:
|

I have a series of <div/>'s as follows:

<div>.co.uk</div>  
<div>.com</div>  
<div>.gb.com</div>  
<div>.uk.com</div>  
<div>.net</div>

How do I select just the divs containing .co.uk, .com, .net.

If I use:

$('div:contains(".co.uk"), div:contains(".com"), div:contains(".net")`)

This causes the .gb.com and .uk.com divs to be selected as well.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about JavaScript