title: create attribute in js triggers an exception 'not a function'
body: <p>I'm using js to change the contents of a div that contents inputs i want to use them with Ajax ,
  I've used Firefox scratchpad to debug this function:</p>
  
  <pre><code>function show(id){
  var div = document.getElementById('com');
  div.innerHTML = '';
  var input1 = document.createElement('input')
              .createAttribute('type').setAttribute('type', 'hidden')
              .createAttribute('value').setAttribute('value',id )
              .setAttribute('name','id' );
  var input2 = document.createElement('input')
               .createAttribute('type').setAttribute('type', 'input')
               .createAttribute('name').setAttribute('name', 'com');
  var btn = document.createElement('button')
            .createAttribute('onClick').setAttribute('onClick', 'post()');
  btn.innerHTML = 'Comment';
  div.appendChild(input1).appendChild(input2).appendChild(btn);
  }
  </code></pre>
  
  <p>and what i got is this:</p>
  
  <pre><code>/*
  Exception: document.createElement(...).createAttribute is not a function
  @Scratchpad/2:2
  */
  </code></pre>
  
  <p>I understood nothing, any ideas?</p>