display none html code code example Example 1: how to hide div in html document.getElementById('elementName').hide(); Example 2: hide in css display:none;