I have 6 values (room types) in a dropdown list which I have retrieved from the database. I want to display a div according to the selected value in the dropdown list without clicking the submit button.
My code to retrieve the value from database is:
<?php
$sql = "SELECT roomtype_des FROM roomtype";
$result=mysqli_query($con,$sql);
while($row=mysqli_fetch_array($result))
echo "<option value='" . $row['roomtype_des'] . "' >" .$row['roomtype_des']
."</option>";
?>
the only problem is I don't know how to display a div according to the selected value.
NOTE that I have 6 different divs of the 6 selected value.