title: create a group of checkboxes with a click event associated Javascript
body: <p>I'm creating a javascript function that builds a table with checkboxes.
  I want associate a click event to them.
  The event must be the same for all.</p>
  
  <p>This is a part of my code:</p>
  
  <pre><code>var i = 0;
  for (i = 0; i &lt; data.Items.length; i++) {
      var tr = $(document.createElement('tr'));
      tr.addClass("MyBookings_table_content");
      $("#MyBookings_table").append(tr);
  
      //Create a CheckBox Element
      var chkbox = document.createElement('input');
      chkbox.type = "checkbox";
      chkbox.id = "chk"+i.toString();
      chkbox.name = "chk" + i.toString();
      //Event here
  }
  </code></pre>
  
  <p>Can anybody help me?</p>