Toggle class on and off in jquery with button : <p>I'm new to javascript but I'm having a hard time toggle this class on and off.</p>

<p><a href="https://jsfiddle.net/spadez/o2s0hmtv/2/" rel="nofollow">https://jsfiddle.net/spadez/o2s0hmtv/2/</a></p>

<pre><code>$( "#togglebtn" ).click(function() {
  $(.mynav).toggleClass( "modal" );
});
</code></pre>

<p>Based on tutorials this should work, but the button doesn't seem to do anything. Can anyone show me where I went wrong please?</p>
