hide div in javascript

JavaScript
document.getElementById('elementName').hide();function myFunction() {
  var x = document.getElementById("myDIV");

    if (x.style.display 
=== "none") {
    x.style.display = "block";
  } else {
    x.style.display = 
  "none";
  }
} var link = document.getElementById('nav-ask');
link.style.display = 'none'; //or
link.style.visibility = 'hidden';
Source

Also in JavaScript: