css or xpath selector: elements which have any attribute with specific value

I want to match all elements in an HTML Dom tree which have any attribute with the value "foo". It should either be a CSS or a XPath selector.

My naive approach would be something like this as css selector:

*[*='foo']

How is the correct syntax?

5
задан BoltClock 12 April 2011 в 11:51
поделиться