I have this html
and this CSSCode:<div id="AuctionItem"> <textarea name="AuctionItemDescription" cols="85" rows="3" onfocus="javascript:if(this.value=='Please describe your auction item here and include its value.')this.value=''" >Please describe your auction item here and include its value.</textarea> </div>
and this JSCode:#AuctionItem { display:none; }
(Although not shown above, due credit is given to Martial Boissonneault at getElementById.com)Code:function ShowDescription() { showBlock("AuctionItem"); } function showBlock(id){ // Netscape 4 if(ns4){ document.layers[id].display = "block"; } // Explorer 4 else if(ie4){ document.all[id].style.display = "block"; } // W3C - Explorer 5+ and Netscape 6+ else if(ie5 || ns6){ alert(document.getElementById(id).style.display); document.getElementById(id).style.display = "block"; alert(document.getElementById(id).style.display); } }
Although I don't believe it should matter, "AuctionItem" is within a table. The initial alert shows nothing, while the second shows 'block'; the div remains hidden. When I change the CSS manually and refresh, it appears as desired. How do I change the div's display property from 'none' to 'block' through JavaScript in IE? It works in FF.
Thanks for any and all suggestions.






Bookmarks