When ASP.NET controls are rendered their ids sometimes change, like if they are in a naming container. Button1 may actually have an id of ctl00_ContentMai
Button1
ctl00_ContentMai
You can get the ID by using document.getElementById method as well.
document.getElementById