title: Not able to create a table row from the check action of a dynamically created checkbox in javascript
body: <p>I am trying to create a row of a table on the check action of a checkbox which is created dynamically. The flow is not entering the function on the check event.</p>
  
  <pre><code>addCheckboxItems : function(form){
      var newBox = ('&lt;input type="checkbox" name="checkBoxItem" onCheck="JavaScript:addRowItems(this)"; id="checkBoxItemId" value="' + form.combobox.value +'"'+ '&gt;'+form.combobox.value);
      document.getElementById("divCheckbox").innerHTML = newBox;
  
      }
      addRowItems : function(element){
      alert('Hi');
      if(document.getElementById("checkBoxItemId").checked){
          var tableRef =  document.getElementById('tbl').getElementsByTagName('tbody')[0];
          var newRow   = tableRef.insertRow(tableRef.rows.length);
          var td1 = document.createElement("td")
          var strHtml1 = document.getElementById('checkBoxItemId').value;
          td1.innerHTML = strHtml1.replace(/!count!/g,count);
  
          var td2 = document.createElement("td")
          var strHtml2 = "NA";
          td2.innerHTML = strHtml2.replace(/!count!/g,count);
  
          var td3 = document.createElement("td")
          var strHtml3 = "&lt;a&gt;Remove&lt;/a&gt;";
          td3.innerHTML = strHtml3.replace(/!count!/g,count);
  
          newRow.appendChild(td1);
          newRow.appendChild(td2);
          newRow.appendChild(td3);
  
          tableRef.appendChild(newRow);
      }
  }
  </code></pre>
  
  <p>How can I achieve this.....Thanks in advance..</p>