Why?
when I select a option in a select field, the selected=\"selected\" attribute still stays on the previous option. But visually you can see that the
selected=\"selected\"
Selecting an option from the dropdown doesn't modify the selected attribute in the DOM. But if you query the current value using $('#selectId').val() it would return the value of the currently selected option.
selected
$('#selectId').val()