title: How to disable the onclick event once it happens?
body: <p>I had a image which calls <code>add_cart()</code> JavaScript function when <code>onclick()</code></p>
  
  <pre><code>&lt;img src="images/add.png" onclick="add_cart()"&gt;
  </code></pre>
  
  <p>I want the user to click the image only one time. When the user clicks it first time, <code>add_cart</code> function should be called. If he clicks second time no event should happen.</p>