According to SitePoint (and my own experiments), the IE implementation of \"setAttribute()\" is buggy and unreliable.
Also according to SitePoint, the name
name
Have you tried simply assigning a new name to the elements name property? I'm not sure how cross-browser that is but it shold work with anything supporting DOM level 1.
I'm not sure why you would use setAttribute to perform this?