jQuery - selected attribute on options doesn't show in FireBug

别说谁变了你拦得住时间么 提交于 2019-12-01 08:42:23

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!