How to get the id of a button that fired a function?
<p>I have a button</p>

<pre><code>   &lt;button onclick="DeletaItem('template','1234')" id="btn"&gt;Deletar_func&lt;/button&gt;
</code></pre>

<p>And the function</p>

<pre><code>   function DeletaItem(tipo,id_cripto){
       alert(tipo+id_cripto);
       alert($(this).attr('id'));
   }
</code></pre>

<p>Why the second alert is undefined?</p>
