IE 6 Does Not Support setAttribute()

As the title of this post suggests, IE 6 (and I’ll assume any version prior) has an incomplete or missing implementation of the setAttribute() method. If you attempt to use this method, the script will terminate and throw a nasty error that may potentially cause a client to think you’re an amateur.

There is a work around, but it’s about as ugly as it can get. Essentially you must use innerHTML to maually inject the code into a parent element. Fortunately, they somehow managed to get the createElement(), appendChild(), and removeChild() right.

This entry was posted on Friday, January 26th, 2007 at 3:22 am and is filed under JavaScript. Both comments and pings are currently closed.

Comments are closed. Sorry.

Site Stuff

Pages

Projects

Archives

Categories