title: Click toggle with jquery/javascript
body: <p>I want to click a table element and to have it do x the first click and if clicked again perform Y</p>
  
  <pre><code>&lt;td class='p' id='e1' onclick="myFunction2()"&gt;&lt;img src='person2.png'/&gt;&lt;/td&gt;
  </code></pre>
  
  <p>Thats what I have for my HTML for one click just now, but I wish to change that so that an item can be selected, then if clicked again for a deselect it would then trigger a different function.</p>