jquery function is not working as event handler
<p>Can anyone tell me why this function is not working ?</p>

<pre><code>for(var i=1;i&lt;=12;i++)
{
  var btn=$('&lt;div&gt;Button&lt;/div&gt;').attr('id', 'id_'+i).button();
  btn.css('margin','10px').on('click', showId());
  btn.appendTo($('#buttons'));    
}

function showId(){
   alert($(this).attr('id'))
}
</code></pre>
