title: Call to Javascript function with in dynamically created HTML <a> tag not working
body: <p>This seemed to be a simple javascript but I feel so dumb to ask this question.. but I don't know why this is not working. I have a method that dynamically creates some hyperlinks on the page. The hyperlinks are suppose to call an executable with a url as parameter. So, I use href with a call to this function that has the code to call the executable. </p>
  
  <p>Non-dynamic anchor tag code works just fine to launch an exe.</p>
  
  <p>But, I need this to work with dynamic hyperlinks. I have tried to simplify the problem and created the following <a href="http://jsfiddle.net/Fw56g/1/" rel="nofollow">jsFiddle</a> to demonstrate the issue. The link doesn't call my method. Am I missing something stupid? I want this to work in IE.</p>
  
  <p>I already tried some solutions posted by some people saying:  I should try <code>href="#" onclick="myfunc();"</code>. Somehow that didn't work either. </p>
  
  <p>Here is my code:</p>
  
  <pre><code>function myfunc(url){
      alert(url);
  };
  
  function dynfunc(){
      var value = "This is a link";
      var url="http://www.google.com";
      var table = $("&lt;table id='tab1'&gt;&lt;/table&gt;");
      var row = $("&lt;tr&gt;&lt;/tr&gt;");
      var valueColumn = $("&lt;td&gt;&lt;/td&gt;");
      $('&lt;a href="javascript: myfunc(\'' + url + '\');"&gt;&lt;/a&gt;').html(value).appendTo(valueColumn);
  
      valueColumn.appendTo(row);
      row.appendTo(table);
      $("#div1").append(table);
  };
  
  dynfunc();
  </code></pre>