NOTE :: IE does *NOT* support hasAttribute(name)

四月 19, 2009

HTMLElement in IE does NOT support hasAttribute(name) because IE does not play with DOM Level 2 methods. So, use getAttribute(name) != null instead of hasAttribute(name).

P.S. Similarly, use attributes.length > 0 instead of hasAttributes().

一個回應 至 “NOTE :: IE does *NOT* support hasAttribute(name)”

  1. dori 說:

    but life would be even easier to just use jQuery~ : P


留言