[JQuery] equivalent of window.top

Hello

I’ve been trying to do something but I’m stuck…
I think the equivalent of window.top is $(document).parent() right?

But I need to select something in that parent, how can I do that?

Something theoretically would like like this


$(document).parent().$("#objectId").html("mytext");

thank you

Why not just use window.top rather than some convoluted long around the world three times way of eventually reaching the same point.

I agree with felgall, just use window.top

If you want to use jQuery functionality on it then you might need to use the $ wrapper:


$(window.top)

Thank you for your replies, i m already using


window.top.$("#objectId").html("mytext");

but do I understand from you that I can use the following?


$(widow.top).$("#objectId").html("mytext");

thank you:)

Try:


$(window.top).find("#objectId").html("mytext");