return
return

Reputation: 1049

show webpage in iframe when we click a link

how i can to show webpage in iframe when click a link? :-?

with this code we can show example.com during document load. but i want to make that when click a link in this document.(This iframe must show in a table.)

<table border="1">
<tr>
<td style="width:500px;height:400px">
<iframe src='http://example.com' frameborder="0" style="width:100%;height:100%"></iframe>
</td>
</tr>
</table>

Thanks.

Upvotes: 0

Views: 10574

Answers (1)

Dion
Dion

Reputation: 3345

Give the iframe a name (<iframe name='youriframe' src='' ...></iframe>) and add target='youriframe' to your link e.g.: <a href='http://example.com/' target='youriframe'>Click!</a>

Upvotes: 3

Related Questions