0
I’m trying to hide an object in Javascript, I’m using the command style.display = 'none';
but unsuccessfully yet.
How can I hide the object by Javascript, not CSS?
source code is on this page http://natupote.net16.net/
0
I’m trying to hide an object in Javascript, I’m using the command style.display = 'none';
but unsuccessfully yet.
How can I hide the object by Javascript, not CSS?
source code is on this page http://natupote.net16.net/
0
Follows a way to hide this HTML element:
document.getElementById("form-tab-2").style.display = "none";
For testing: access the page URL with Google Chrome, then press F12, click "Console" option, type the above command in the console and type ENTER.
After typing and typing enter:
To apply to your Javascript and make sure that this element is not being displayed, place the code below at the beginning of your Javascript:
document.addEventListener("DOMContentLoaded", function(event) {
setTimeout(function(){
document.getElementById("form-tab-2").style.display = "none";
}, 1000);
});
I taped this command and haven’t hidden it yet
i’m doing it in plunkr https://embed.plnkr.co/fXDmAe6uClOY80AIGwp9/
understood, it really works, but I’m trying to attach this command in the source code of the page, so that at startup hide the object, still unsuccessful...
In Plunk it worked: put the code below at the beginning of your Javascript: Document.addeventlistener("Domcontentloaded", Function(Event) ? setTimeout(Function(){ Document.getElementById("form-tab-2").style.display = "None"; }, 1000); });
I edited the answer.
Tested it? It worked?
it worked yes, thanks, you did in 50 min what I’m trying to do already 1 day
Browser other questions tagged javascript html
You are not signed in. Login or sign up in order to post.
Because form-tab-2 is not in: /BOOT GO TO BANDEIJA/ ?
– Allan Andrade
because it I do not want to hide it by CSS, only by javascript, I want to hide and display it with the pressing of a button that I will do in the future, but the focus of the problem is to hide the boot by javascript same
– Vitor Marques Lourenço
i did what you said by Chrome console and it even worked, but I’m trying to attach the command you said in the source code of the page, so it runs alone, thanks for the help
– Vitor Marques Lourenço
i am editing Pelop plnkr https://embed.plnkr.co/fXDmAe6uClOY80AIGwp9/ if you open will see q I pasted your command in <script> and have not had success yet
– Vitor Marques Lourenço