Selected Radio option using change() not working as expected with JQM (jQueryMobile)

删除回忆录丶 提交于 2019-12-06 04:55:50

It is a very interesting behavior. The change function is called onclick by JQM, then you see the alert message and after clicking ok on the alert message you will see that the selected value of the radiobox will switch. So the function is called before the change was done, and so the value is wrong. But the reason why, hmm... I solved it:

Do this:

alert($('input[name=first_radio]:checked').val());

See here: http://jsfiddle.net/fSbk9/6/

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