I have a basic script which shows/hides a div. I'm using this for a drop-down menu.
https://www.w3schools.com/howto/howto_js_toggle_hide_show.asp
I'm looking for the div element to be hidden when the page loads instead of it showing and having to click it to toggle it.
Any help is appreciated!
Use display: none
in div like below
<div id="myDIV" style="display:none">
This is my DIV element.
</div>
or you can create a class and assign to the div.
<style>
.hide{
display:none;
}
</style>
<div id="myDIV" class="hide">
This is my DIV element.
</div>
Instead of CSS, you may also use JavaScript to manipulate the display of a web page by taking advantage of events, such as onload.
window.onload = function(){
document.getElementById("myDIV").style.display='none';
};
<div>
This is the first DIV element.
</div>
<div id="myDIV">
This is the 2nd DIV element.
</div>
<div>
This is the last DIV element.
</div>
I'm using this library here: ng-sortable And I'm using it on a table. The thing is, when I physically drag a table row, the row shrinks and doesn't keep the original look of the table. I narrowed ...
I'm using this library here: ng-sortable And I'm using it on a table. The thing is, when I physically drag a table row, the row shrinks and doesn't keep the original look of the table. I narrowed ...
I have the following array var x = [{"id":"757382348857","title":"title","handle":"linkhere","productimage":"url","ippid":true,"location_x":26,"location_y":18}] And i am trying to add the following ...
I have the following array var x = [{"id":"757382348857","title":"title","handle":"linkhere","productimage":"url","ippid":true,"location_x":26,"location_y":18}] And i am trying to add the following ...
An API I'm working with is returning poorly structured data like this: { "scsi0": "vm-101-disk-1.qcow2,size=32G", "scsi1": "vm-101-disk-2.qcow2,size=32G", "scsi2": "vm-101-disk-3.qcow2,...
An API I'm working with is returning poorly structured data like this: { "scsi0": "vm-101-disk-1.qcow2,size=32G", "scsi1": "vm-101-disk-2.qcow2,size=32G", "scsi2": "vm-101-disk-3.qcow2,...
My submit button is finally working. However, it is not counting all of the votes in the results. How do I get my submit button to sort all of the votes? HTML: <!DOCTYPE html> <html&...
My submit button is finally working. However, it is not counting all of the votes in the results. How do I get my submit button to sort all of the votes? HTML: <!DOCTYPE html> <html&...