title: how to set form attribute on a createElement input with Javascript
body: <p>can someone please help me out?
  I'm trying to create an input dynamically with this function, but the "form" <strong>attribute</strong> is not being set.</p>
  
  <pre><code>function addInput(parentID,inputNAME) {
      var padre = document.getElementById(parentID);
      var container = document.createElement("input");
      container.type = "text";
      container.name = inputNAME;
      container.value = "";
      container.form = 'extra';
      var enter = document.createElement("br");
      padre.appendChild(container);
      padre.appendChild(enter);
  }
  </code></pre>
  
  <p>I've also tried with this:</p>
  
  <pre><code>container.formName = 'extra';
  container['form'] = 'extra';
  container.attributes['form'] = 'extra';
  container.createAttribute('form','extra')
  </code></pre>
  
  <p>EDIT:<br>
  Answer:<br>
  <code>container.setAttribute("Form",'extra');</code></p>