What to use instead of CONTAINS() in CSS3

前端 未结 2 864
借酒劲吻你
借酒劲吻你 2021-02-19 11:23

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 rea

相关标签:
2条回答
  • 2021-02-19 11:46

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

    element[attribute*="substring"]
    

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

    0 讨论(0)
  • You can use jQuery :contains(text)

    <script src="https://code.jquery.com/jquery-1.10.2.js"></script>
    
    <script>
        $( "div:contains('foo')" ).css( "text-decoration", "underline" );
    </script>
    
    0 讨论(0)
提交回复
热议问题