开发者

What to use instead of CONTAINS() in CSS3

开发者 https://www.devze.com 2023-03-19 03:19 出处:网络
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

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?


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.


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

精彩评论

暂无评论...
验证码 换一张
取 消