How to hide any div inside html form if internet is not availaible : <p>Hello Guys I would like to know if it is possible to hide the div if the internet is not availaible.
Here is the code</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>if(navigator.onLine) { 
     //show
}
else{
//Hide
} </code></pre>
</div>
</div>
</p>

<p>Thanks in advance.</p>
