问题
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 new option is active
回答1:
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.
来源:https://stackoverflow.com/questions/4842159/jquery-selected-attribute-on-options-doesnt-show-in-firebug