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.
echo “”;
while($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo "<option id='".$row['Id']."' value='".$row['name']."'>".$row['name']."</option>";
}
echo "</select>";
above is the code. how can i do this.
1 Answer