读书人

怎样在Jquery中动态绑定RadioButtonLi

发布时间: 2013-03-21 10:08:17 作者: rapoo

求助怎样在Jquery中动态绑定RadioButtonList的选项?
怎样在Jquery中动态绑定RadioButtonList的选项?


之前使用jquery创建节点append到DIV中,明明设置了name属性,但IE6中还是选中不了。纳了闷了。
var NewNode = document.createElement("input");
NewNode.setAttribute("name", "sp");
NewNode.setAttribute("id", item.id);
NewNode.setAttribute("value", item.mc);
NewNode.setAttribute("type", "Radio");
$("#SP").append(NewNode);
现在想着有没有办法像select一样options.add(new Option(item.mc, item.id));就能搞定动态绑定RadioButtonList的选项的。不知道是不是我比较愚昧。
希望能得到各位的帮助!?? jquery ie
[解决办法]
LZ直接给RadioButtonList的innerText和value属性赋值不行吗?
[解决办法]
$("#SP").append("<input type='radio' checked='checked' id='xx' value='xx' />");
[解决办法]
$("#SP").append("<input type='radio' checked='checked' id='xx' value='xx' />");
[解决办法]
http://bbs.csdn.net/topics/390362473
给你收了一下,现成大把的例子,楼主可以直接用
[解决办法]
$("#SP").append("<input type='radio' checked='checked' id='xx' value='xx' />");

读书人网 >asp.net

热点推荐