title: Convert html select option list to radio buttons
body: <p>I have a html page which works with select/option and I want to convert this feature to input type=radio (list to radio butons).</p>
  
  <p>Actually i have a list of selects like this:</p>
  
  <pre><code>&lt;select name="DEC-51537a4b580452b9e145b75c-A"&gt;
  &lt;option selected="" value="OK"&gt;OK&lt;/option&gt;
  &lt;option value="NOK"&gt;NOK&lt;/option&gt;
  &lt;/select&gt;
  
  &lt;select name="DEC-51537a4b58045459e145b75c-R"&gt;
  &lt;option selected="" value="OK"&gt;OK&lt;/option&gt;
  &lt;option value="NOK"&gt;NOK&lt;/option&gt;
  &lt;/select&gt;
  
  &lt;select name="DEC-51537a88880452b9e145b75c-A"&gt;
  &lt;option selected="" value="OK"&gt;OK&lt;/option&gt;
  &lt;option value="NOK"&gt;NOK&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>The user select the value that he want and click on a button.The button call a javascript which get the result for each "DEC-".</p>
  
  <p>For each select which start with "DEC-", I retrieve :
   - dec-number (51537a88880452b9e145b75c for example)
   - original dec value (A or R)
   - and i get select.value in order to retrieve the dec value select by the user</p>
  
  <p>If i want to convert select to input type=radio, first of all I have change select to this:</p>
  
  <pre><code>&lt;input name="DEC-51537a4b580452b9e145b75c-A" type="radio" checked value="A"&gt;A
  &lt;input name="DEC-51537a4b580452b9e145b75c-A" type="radio" value="R"&gt;R
  </code></pre>
  
  <p>And here the javascript function which works with select but not radio buttons:</p>
  
  <pre><code>  var elements = $doc.getElementsByTagName('select');
  
    var sel;
  
    for(var i=0; i&lt;elements.length; i++){
        sel = elements[i];
  
         if(sel.name.indexOf('DEC-') === 0){
            var selName = sel.name.split('-');
            var oid = selName[1];
            var originalDecision = selName[2];
            var supervisorDecision = sel.value;
  
            decisions++;
            if(originalDecision == supervisorDecision) {
                rightDecisions++;
            } else {
                wrongDecisions++;
  
                if(originalDecision == "ACCEPTED") {
                    originalDecision="&lt;h3 class='green'&gt;ACCEPTED&lt;/h3&gt;";
                } else if(originalDecision == "REFUSED") {
                    originalDecision="&lt;h3 class='red'&gt;REFUSED&lt;/h3&gt;";
                }
  
                if(supervisorDecision == "ACCEPTED") {
                    supervisorDecision="&lt;h3 class='green'&gt;ACCEPTED&lt;/h3&gt;";
                } else if(supervisorDecision == "REFUSED") {
                    supervisorDecision="&lt;h3 class='red'&gt;REFUSED&lt;/h3&gt;";
                }
  
                var content = $doc.getElementById(oid).innerHTML;
                wrongDecisionsTab += "&lt;tr&gt;&lt;td&gt;" + content + "&lt;/td&gt;&lt;td&gt;" 
                 + originalDecision + "&lt;/td&gt;&lt;td&gt;&lt;h3&gt;" + supervisorDecision + "&lt;/h3&gt;&lt;/td&gt;&lt;/tr&gt;";
            }
  
        }
  
    }
  </code></pre>
  
  <p>I need the same things but with radio buttons, so i have tried to change:</p>
  
  <pre><code>  var elements = $doc.getElementsByTagName('input');
  </code></pre>
  
  <p>but it's not sufficient.
  What i'm missing?</p>