CSS selector based on element text?

css, css-selectors

Solution

Not with CSS directly, you could set CSS properties via JavaScript based on the internal contents but in the end you would still need to be operating in the definitions of CSS.

Problem

Is there a way to select an element in css based on element text? ie: ``` li[text=*foo] <li>foo</li> <li>bar</li> ``` That probably doesn't work. Edit: Also only need to support Chrome.

Original source

Related problems