dynamic retreival of option id of HTML Select's using js
<p>i am dynamically generating a html page using php in which i am generating a dropdown combo which have attributes id and value, on selection of any option i want to get the value and id of selected option using js. </p>

<p>echo "";</p>

<pre><code>    while($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
        echo "&lt;option id='".$row['Id']."' value='".$row['name']."'&gt;".$row['name']."&lt;/option&gt;";
    }
    echo "&lt;/select&gt;";
</code></pre>

<p>above is the code. how can i do this.</p>
