JSFiddle - React, Tailwind, and code Playground

by deepak sisodiya

HTML

<h1>this is first line</h1>
<h1 style="visibility:hidden">this is second line</h1>
<h1>this is third line</h1>
<hr/>
<h1>this is fourth line</h1>
<h1 style="display:none">this is fifth line</h1>
<h1>this is six line</h1>

JavaScript

visibility: hidden -> hides the element, but height and width are not set to zero so that takes up space in the layout.

display: none -> set dimensions to zero, but it do not removes the element from document, you can still access Node using document.getElementById("id")