Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我试过了:
$(document).ready(function(){ $(parent.top).find('.IAgreeCheckBox:first').prop("checked", true); });
无济于事。
$('.IAgreeCheckBox:first', window.parent.document).prop('checked', true);
你会想要document对象,而不是window:
document
window
$(parent.document).find('.IAgreeCheckBox:first')
这是一个演示。
如果上下文方法不起作用,请尝试以下操作:
parent.$("#wOnlineApplication_cbxIAgree").prop("checked", true);
这就是我在 iframe 页面中引用父元素的方式。