How to hide an object in javascript

0

I'm trying to hide an object in JavaScript, I'm using the style.display = 'none'; command but not yet successful.

How can I hide the object by JavaScript, not by CSS?

object:

thesourcecodeisonthispage link

link

    
asked by anonymous 24.08.2016 / 16:56

1 answer

0

Here's a way to hide this Html element:

document.getElementById("form-tab-2").style.display = "none";

To test: Access the URL of the page with Google Chrome, then press F12, click the "Console" option, enter the above command on the console and press ENTER.

Aftertypingandenterenter:

ToapplytoyourJavaScriptandmakesurethiselementisnotappearing,putthecodebelowatthebeginningofyourJavaScript:

document.addEventListener("DOMContentLoaded", function(event) {   
    setTimeout(function(){
         document.getElementById("form-tab-2").style.display = "none"; 
    }, 1000);
});
    
24.08.2016 / 17:04