title: How can I have a jQuery onclick function return the element instead of the event?
body: <p>I have a function called deleteTask which currently just does <code>console.log(this)</code></p>
  <p><code>&lt;input type=&quot;button&quot; value=&quot;Delete Task&quot; onclick=&quot;deleteTask()&quot;/&gt;</code> (note that this in a jQuery function, not in a HTML file) returns <code>[object Window]</code></p>
  <p>while <code>del.onclick = deleteTask;</code> (where del is the input button) returns the object that was clicked, in this case, <code>&lt;input&gt;</code></p>
  <p>How can I have the jQuery version output similarly to the pure JS one?</p>