title: How to use onclick event on a list (jqueryui-selectable)?
body: <p>I created a simple script with jqueryui-selectable list. I generate a selectable list and assign each list with an onclick function. It seems that the onclick event was not triggered when I clicked the list. Any idea to solve this problem?</p>
  
  <p>Thanks,</p>
  
  <p>my script:</p>
  
  <pre><code>$(document).ready(function() {
  $("#myButton").button();
  });
  
  function generate(){
  var $content=$("&lt;ol id='selectable'&gt;");
  for (a=0;a&lt;3;a++)
  {
  $content.append("&lt;li class='ui-widget-content'  onclick='myFunction()'&gt;item"+a+"&lt;/li&gt;");
  }
  $content.append("&lt;/ol&gt;");
  $("#myList").append($content);
  $('#selectable').selectable();
  }
  
  function myFunction()
  {
  alert("Hello World!");
  }
  </code></pre>
  
  <p>my style:</p>
  
  <pre><code>#feedback { font-size: 1.4em; }
  #selectable .ui-selecting { background: #FECA40; }
  #selectable  .ui-selected { background: #F39814; color: white; }
  #selectable  { list-style-type: none; margin: 0; padding: 0; width: 60%; }
  #selectable  li { margin: 3px; padding: 0.4em; font-size: 1.4em; height: 18px; }
  </code></pre>
  
  <p>my html:</p>
  
  <pre><code>&lt;div id='myList'/&gt;
  &lt;button id="myButton" onClick="generate()"&gt;Generate List&lt;/button&gt;
  </code></pre>