This line: ScrollOff=document.getElementById("Marquee"+Btn).removeAttribute("behaviour"); alert(ScrollOff); Code (markup): Returns false, although setAttribute sets the attribute, it leaves the old attribute in place. What's up?