title: How to use "this" reference of the element calling the function?
body: <p>For example I want a function that is used by many elements to get the attributes of the calling element.</p>
  
  <pre><code>function example(){
      var name = //name of the calling element "$(this).attr('name')"
  }
  &lt;button name="somename1" onclick="example()"&gt;Button1&lt;/button&gt;
  &lt;button name="somename2" onclick="example()"&gt;Button2&lt;/button&gt;
  </code></pre>
  
  <p>so if the button named 'somename1' calls the function, the variable 'name' will be assigned to 'somename1' and so if 'somename2' called it, it will be assigned to 'somename2'</p>