setting display doesn't work : I am working with a captcha.  Upon success I want to set the display of the div that includes the captcha to "none".  In that success part I have:

document.getElementById("mainForm").style.display="block"; 
document.getElementById("captcha").style.display="none";
alert("the captcha display is " + document.getElementById("captcha").style.display);

The resulting alert says that it is block (how the div was defined above this code), even though I have just set it to none.

Any idea why?  (The alert was just for debugging purposes).