0

我试过了:

$(document).ready(function(){
    $(parent.top).find('.IAgreeCheckBox:first').prop("checked", true);  
});

无济于事。

4

3 回答 3

5
$('.IAgreeCheckBox:first', window.parent.document).prop('checked', true);
于 2012-06-27T22:48:29.463 回答
3

你会想要document对象,而不是window

$(parent.document).find('.IAgreeCheckBox:first')

这是一个演示。

于 2012-06-27T22:45:38.607 回答
0

如果上下文方法不起作用,请尝试以下操作:

parent.$("#wOnlineApplication_cbxIAgree").prop("checked", true);

这就是我在 iframe 页面中引用父元素的方式。

于 2012-06-27T23:11:49.020 回答