I have a code that displays horizontally on desktop screens and vertically on phones. It includes an x button (closebtn) that is only displayed on phones to close the menu bar. How can I automatically display it again after resizing the page back to desktop size?
function oty() {
document.getElementById("tab").style.display = "none";
}
<div class="icon-bar" id="tab">
<button class="closebtn" onclick="oty()">X</button>
<button class="tablink">Home</button>
<button class="tablink">News</button>
<button class="tablink">Contact</button>
<button class="tablink">About</button>
</div>