How to hide a specific div in HTML?

An HTML element is an object that you can use to mark up the content of a page. HTML provides many different elements for different kinds of content. we will learn how to use some very simple HTML elements in order to hide certain parts of a webpage. Some text about what are divs, and what is the difference between primary, secondary, and named divs. 

Javascript getelementbyid hide element

on Jan 01, 1970
// Toggle between hiding and displaying an element
<div id="myDIV" onclick="javascript:myFunction()">myDiv</div>
<script>
function myFunction() {
  var x = document.getElementById('myDIV');
  if (x.style.display === 'none') {
    x.style.display = 'block';
  } else {
    x.style.display = 'none';
  }
}
</script>

Add Comment

0

how to hide div in html

on Jan 01, 1970
document.getElementById('elementName').hide();

Add Comment

0

It will also have a comparison between divs and their alternatives. It will also be accompanied by some images.

Html answers related to "javascript hide div by id"

View All Html queries

Html queries related to "javascript hide div by id"

Browse Other Code Languages

CodeProZone