Why won't an anchor tag generated with JQuery fire its onclick event?
<p>I am dynamically generating an anchor tag using jQuery. I have added an onclick attribute to it but when I click on the link the onclick does not fire.</p>

<p>I am generating the link as follows:</p>

<pre><code>$(document).ready(function() {

 var attributes = {
  "id": "xxx",
  "onclick": "alert('xxxx');",
  "href": "https://localhost/widget/TabTest.aspx#"
 };
 var link = $.create("a", attributes);
 $(link).append("xxxx");
 $("#WidgetContainer").append(link);
});
</code></pre>
