Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 5th, 2012  |  syntax: None  |  size: 0.40 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Javascript appendChild checkbox onclick not running
  2. var cb = document.createElement('input');
  3. cb.type = 'checkbox';
  4. cb.onclick = newfunction();
  5. cb.name = "done";
  6. cb.value = "done";
  7. theCell.appendChild(cb);
  8.        
  9. cb.onclick = newfunction;
  10.        
  11. cb.onclick = function(){
  12.     newfunction("something");
  13. };
  14.        
  15. cb.onclick = newfunction;//NO BRACKETS in this case
  16.        
  17. cb.onclick = function() { newfunction(); }