RealWorldCoder
RealWorldCoder

Reputation: 1021

Target iFrame window object with jQuery

All the examples I see are using regular javascript, like this:

frames[index].window

I tried:

$("iframe").window

and

$("iframe")[0].window

but it returns undefined

How do I target an iFrame window object like javascript, but in jQuery?

Upvotes: 0

Views: 1012

Answers (1)

taxicala
taxicala

Reputation: 21769

You can access the iframe's window by using the contentWindow property of the iframe:

$("iframe")[0].contentWindow

Upvotes: 1

Related Questions