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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
CSS does not define an attribute selector that takes a wildcard as its name.
XPath, however, does. The following expression should work: