最佳答案
<p data-foo="bar">
How can you do the equivalent to
document.querySelectorAll('[data-foo]')
where querySelectorAll is not available?
I need a native solution that works at least in IE7. I don’t care about IE6.