title: setAttribute, onClick and cross browser compatibility
body: <p>I have read a number of posts about this but none with any solid answer.  Here is my code:</p>
  
  <pre><code>// button creation
  onew = document.createElement('input');
  onew.setAttribute("type", "button");
  onew.setAttribute("value", "hosts");
  onew.onclick = function(){fnDisplay_Computers("'" + alines[i] + "'"); }; // ie
  onew.setAttribute("onclick", "fnDisplay_Computers('" + alines[i] + "')"); // mozilla
  odiv.appendChild(onew);
  </code></pre>
  
  <p>Now, the setAttribute() method (with the mozilla comment) works fine in mozilla but only if it comes AFTER the line above it.  So in other words it seems to just default to whichever gets set last.  The .onclick method (with the ie comment) does not work in either case, am I using it incorrectly? </p>
  
  <p>Either way I can't find a way to make this work at all in IE, let alone in both.  I did change the function call when using the .onclick method and it worked fine using just a simple call to an alert function which is why I believe my syntax is incorrect.</p>
  
  <p>Long story short, I can't get the onclick parameter to work consistently between IE/Mozilla.</p>
  
  <p>-- Nicholas</p>