I want to get the ID value in the department_tbl and put it in the TextBox instead of Alert.
<select name="departmentlvl" id="departmentlvl">
<option value="" >Choose Department Level</option>
<?php
$qry="Select * from department_tbl";
$result=mysqli_query($conn,$qry);
while($row = mysqli_fetch_array($result))
{
extract($row);
echo "<option value='".$department_id."'>".$departmentDesc."
</option>";
}
?>
</select>
<input type="text" id="" value="">// put the id value here($department_id)
//jquery
$(document).ready(function() {
$("#departmentlvl").on('change', function () {
alert($(this).val());
});
});