title: set HTML5 input list value with JavaScript
body: <p>I'm to create a html5 input field with an attached datalist by JavaScript. I'm not having any issues creating these dom nodes, but I am having trouble setting the <code>list</code> attribute value using pure JavaScript. Is this possible? I've checked the functionality of the node and the value of <code>list</code> is there, but whenever I try and set it no new value is assigned. Does anybody have any ideas?</p>
  <p><a href="http://jsfiddle.net/bkTxM/" rel="noreferrer"><strong>Here</strong></a>'s an example in code.</p>
  <pre><code>var _form = document.body.appendChild(document.createElement('form')),
      _input = _form.appendChild(document.createElement('input')),
      _datalist = _form.appendChild(document.createElement('datalist'));
  
  _input.list = 'exampleList';
  _input.datalist_id = 'exampleList';
  _input.className = 'getme';
  
  _datalist.id = 'exampleList';
  
  for (var i = 0; i &lt; 5; i++) {
      var _option = _datalist.appendChild(document.createElement('option'));
      switch(i){
          case i:
              _option.value = i;
              break;
      };
  };
  </code></pre>
  <p><strong>Edit</strong></p>
  <p>I have found a method of doing this via the <code>element.setAttribute();</code> method. How would one go about doing this in a syntax similar to (for example) <code>element.className = 'value';</code>.</p>
  <p>Thank you in advance!</p>