title: How to add 'selected' on a option using 'setAttribute' with javascript
body: <p>Fro example, I have this, and im trying to set by default option1, will be selected for default, how i can do it only using OPT.setAttribute(...,..):</p>
  
  <pre><code> var SELECT = document.createElement('SELECT');
  
   var OPT1 = document.createElement('OPTION');
   OPT1.setAttribute('value', 0);
  
   var OPT2 = document.createElement('OPTION');
   OPT2.setAttribute('value', 0);
  
   OPT1.appendChild( document.createTextNode( 'option1' ) );
   OPT2.appendChild( document.createTextNode( 'option2' ) );
  
   SELECT.appendChild(OPT1);
   SELECT.appendChild(OPT2);
  </code></pre>
  
  <p>Im trying this : </p>
  
  <pre><code>OPT1.setAttribute('selected','true'); 
  </code></pre>
  
  <p>Obviusly dont work, thanks for help. :)   </p>