rassom
rassom

Reputation: 2966

Is it possible to change elements in Object tag in HTML? If yes, how?

I have a HTML page where part of its contents is an external web page loaded into it with a HTML object tag like this:

<object data="someUrl-on-different-domain-than-host" type="text/html"></object>

Now, through jQuery or similar, I want to manipulate the contents of <div id="mydiv"> in the page that someUrl represents.

Is that possible? If yes, how?

Thanks :-)

Upvotes: 0

Views: 324

Answers (1)

Ramzan Zafar
Ramzan Zafar

Reputation: 1600

use Jquery load

$("#mydiv").load("YOUR_URL");

your content from provided will be load into this div automatically

updated

If you want to get some specific content like a div with id mychilddiv you can do it like

$("#mydiv").find('#mychilddiv');

Upvotes: 1

Related Questions