how to close sidebar by click inside body
<p>hey i have an offcanva sidebar wich works pretty good. What i would to change is, that the users should close the sidebar by cklicking wherever they whant. For example inside the body.</p>

<p>At the moment is there a close button inside the sidebar which brings it back to default.</p>

<pre><code>function openNav() {
    document.getElementById("left-sidebar").style.width = "250px";
}

function closeNav() {
    document.getElementById("left-sidebar").style.width = "0";
}
</code></pre>

<p>opens sidebar</p>

<pre><code>&lt;a href="#"  onclick="openNav()"&gt;&lt;i class="icon-menu"&gt;&lt;/i&gt;&lt;/a&gt;
</code></pre>

<p>close sidebar</p>

<pre><code>&lt;a href="javascript:void(0)" class="closebtn" onclick="closeNav()"&gt;&lt;/a&gt;
</code></pre>