Paul Smith
Paul Smith

Reputation: 173

Button in parent iframe click inside iframe

i'm trying to make a nav bar with the contents below in an iframe and i'm wanting the nav bar buttons when clicked to load a page in the lower iframe.

The iframe and main page will be on the same server // domain, so i was wondering if anyone could recommend something ?

I had a lil Google and found this: iframe click link it opens in parent page rather than in iframe page

and tried changing parent to child but it didn't work.

Upvotes: 0

Views: 157

Answers (1)

Sunny R Gupta
Sunny R Gupta

Reputation: 5126

Considering an iFrame with name attribute of foo.

<iframe name="foo" src="index.html"></iframe>

Use a link with target foo.

<a href="about.html" target="foo">About</a>

Should work as expected.

Upvotes: 1

Related Questions