开发者

Select a Radio Button in Ajax Response

I have an ajax response that replaces the contents in a div. The response is this:

<input onchange="switch(this.value)" value="val" id="code" checked="checked" type="radio" name="code" />
开发者_C百科

The radio button shows up just fine, however, it is not checked. Any ideas why?


It's a radio button, not a checkbox and maybe another radio button in the same group (i.e. with the same 'name') is already checked.


There is no need to write any code for onclick. The default behavior of radio button is to change its state on click. Also value='val' attribute. I guess it's messing up with checked attribute.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜