Making a div appear and disappear

This makes my div appear (when the display attribute is set to none) using the onclick event:

divTest = document.getElementById('linkContainer2');
if ( === "none") { = '';

I thought this would make it appear and disappear (depending on the display attribute) using the onclick event, but it doesn’t. Why?

divTest = document.getElementById('linkContainer2');
if ( === "none") {
       = '';
         } elseif ( === "") {
        = "none";

Well, the first thing I did was change your “elseif” to “else if” (notice the space) and that got it to work immediately. However, I would also recommend using ‘block’ instead of ‘’ in “ = ‘’;” and remove the if condition in the else statement as shown at

Thanks cpradio. Is JSfiddle your site?

No, I wish I had the creativity to create that, I am just a user of it. It makes answering forum questions very simple :slight_smile:

Just wondered since it’s an alpha.

By the way, thanks again.