【发布时间】:2014-07-11 23:47:54
【问题描述】:
我遇到了一个非常奇怪的错误。执行以下操作后,我的单选按钮未选中:
var $page = $('[data-shortcode-page="' + shortcode + '"]', $webrock).html();
//CHECKED
console.log($('[data-shortcode-page="' + shortcode + '"] :checked', $webrock).length)
$('.webrock-page-content', $addPage).replaceWith($page);
//UNCHECKED
console.log($('[data-shortcode-page="' + shortcode + '"] :checked', $webrock).length)
有人知道为什么会这样吗?这是一个 jsFiddle:http://jsfiddle.net/mVB2q/1/
非常感谢!
【问题讨论】:
-
我想这与
.replaceWith($page)有关。 -
你能加点小提琴吗?
-
这是一个小提琴:jsfiddle.net/mVB2q/1
-
如何重现错误?选择选项时应该调用此代码吗?
标签: javascript jquery html radio checked