JavaEar 专注于收集分享传播有价值的技术资料

What to use instead of CONTAINS() in CSS3

Question about automation. I use Selenium RC.

I upgraded my FF to 3.6.18 and it seems that it can't find any locators which have "contains()" inside

I've read alot of forums. It's a known problem, but I did not find any solution.

So what to use instead of contains() now?


  1. The only functionality in CSS which is similar to contains() is:


    It is helpful when you need to check some substring which contains in the attribute.

  2. 参考答案2
  3. You can use jQuery :contains(text)

    <script src=""></script>
        $( "div:contains('foo')" ).css( "text-decoration", "underline" );