how to completely hide an item when reloading the page with JS?

0

I am hiding a div with the hide () function and if it works, the problem is that when you update the browser several times you see the div for a small moment only, I want to avoid that, that does not appear completely, thanks

    
asked by Shum 02.07.2018 в 02:39
source

2 answers

0

You can put CSS styles at the start and after starting the hidden and remove the style. Something like this:

<div id="mi_div" style="visibility: hidden;"></div>

And in the code you do this:

$('#mi_div').removeAttr('style');
$('#mi_div').hide();
    
answered by 02.07.2018 в 02:50
0

You can use in your javascript a function that contains the html:

<div id="myDIV">Ocultar</div>

and javascript

document.getElementById("myDIV").style.display = "none";
    
answered by 02.07.2018 в 05:42