Sorry, posted the wrong code...
The element's visibility is unchanged, although the alert tells me that its
property was properly set:
function test(id)
{
elem = document.getElementById(id)
if (elem.display == "block")
{
elem.display = "none"
}
else
{
elem.display = "block"
}
alert(elem.display)
}
Paul
"Mick White" <mw***********@rochester.rr.com> wrote in message
news:IM******************@twister.nyroc.rr.com...
PJ6 wrote:
When I call this function (I verified that I'm actually getting an
element with the id), why does IE ignore my attempt to set the display to
none?
<script>
function test(id)
{
elem = document.getElementById(id)
elem.id.style = 'display: none;'
}
</script>
elem.style='display: none' //Not sure about this, though.
OR
function test(id){
document.getElementById(id).style.display = "none"
}
Mick