title: Use one() in inline onclick attribute
body: <p>I have a function that is triggered on an inline <code>onclick</code>.</p>
  <p>What I want is for that function to get called only once but don't know how to do that with an inline <code>onclick</code>. It's working at the moment but runs everytime the user clicks rather than just once.</p>
  <p>This is how I have it:</p>
  <p><code>HTML</code></p>
  <pre><code>&lt;div class= &quot;container&quot; onclick=&quot;modal('#modal')&quot;&gt;&lt;/div&gt;
  </code></pre>
  <p>I have tried having it as a Jquery function as follows and remove the above click but that is not working either:</p>
  <pre><code>$(&quot;.container&quot;).on( &quot;click&quot;, modal( '#modal') {
    alert( &quot;The event happened!&quot; );
  });
  </code></pre>
  <p>Any idea how to make it so the function only runs once?</p>
  <p>Thank you</p>