Combo box id in JavaScript
<p>Can I find the <code>id</code> of a combo box in JavaScript, not its value?</p>

<p>jsp file code</p>

<pre><code>function ChangeColor(colors) {
    var partcolor = (colors.options[colors.selectedIndex].value);

    if (partcolor=="black"){
      document.getElementById("colorRow").style.backgroundColor = 'black';
     } 
    else if(partcolor=="brown")  {
     document.getElementById("colorRow").style.backgroundColor ='brown';
    }   else if(partcolor=="yellow")  {
     document.getElementById("colorRow").style.backgroundColor ='yellow';
    }
}
</code></pre>

<p>java file code                      </p>

<pre><code>public String getColor(String colorName) {
mySB.append("&lt;select onchange=\"ChangeColor(this);\" style=\"font-size:0.8em;\" id=\"").append(colorName).append("\" name=\"").append(colorName).append("\"&gt;")
            .append("&lt;option value=\"\"&gt;&amp;nbsp;&lt;/option&gt;");

}
</code></pre>

<p>How can I print the id of combo box here?</p>
