Search code examples
javascripthtmljquerycsshref

Open link in same page different section


I have two different html files in my application. Something like this.

<a href="/conversations/<%= c['conversation']['id'] %>" class="list-group-item">
  <div id="nav">
   <p>This is link my second page</p>
  </div>
</a>

This is my second page.

div id="nav">
  <p>This is link my second page</p>
</div>

But here when I click on link it is redirect to second page. What I want is when I click on the link I want to open the second html, within the different section of the same page. Some thing like this. enter image description here

How can I do this?


Solution

  • iframe is the tag which you can use for call other html pages into your web page

    <iframe src="http://www.google.co.in" name="targetframe" allowTransparency="true" scrolling="no" frameborder="0" >
    </iframe>