JSFiddle - React, Tailwind, and code Playground

by Robert Hapiuc

HTML

<button class="open">Open Menu</button>
<nav style="display: none">
    <a href="">1</a>
    <a href="">2</a>
    <a href="">3</a>
    <a href="">4</a>
    <a href="">5</a>
</nav>

CSS

.mobileopen { display: block !important; }

JavaScript

jQuery(".open").click(function() {
				jQuery("nav").toggleClass("mobileopen");
			    var text = $(this).text() == 'Close Menu' ? 'Open Menu' : 'Close Menu';
			    jQuery(this).text(text);
		});