Turns out that IE7 and below doesn't support element.hasAttribute