Archive for the 'javascript' Category

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().

廣告