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


i want match elements in html dom tree have attribute value "foo". should either css or xpath selector.

my naive approach css selector:

*[*='foo'] 

how correct syntax?

css not define attribute selector takes wildcard name.

xpath, however, does. following expression should work:

//*[@*="foo"] 

Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -