Find an element in DOM based on an attribute value

Update: In the past few years the landscape has changed drastically. You can now reliably use querySelector and querySelectorAll, see Wojtek’s answer for how to do this. There’s no need for a jQuery dependency now. If you’re using jQuery, great…if you’re not, you need not rely it on just for selecting elements by attributes anymore. There’s not a very short way … Read more