Html – Need html text shown as a link to work with an iframe


I have a page that contains an iframe element. I want to have some text on the main page when clicked to change the iframe source. I can do that with an "a href" tag but the main page resets to the top instead of where the user was last on the page vertically. If I use an input type=button element, then it works just fine without resetting to the top of the main page. However, I want the look of just text on the page (with an underline) instead of a button look. How can I do this?

Best Solution

use target

<a href="page2.html" target="test">Go to page 2</a>
<iframe src="page1.html" frameborder="0" name="test"></iframe>