How to jump another part of the document in the same page?

 Posted by Pgayath on 9/21/2012 | Category: HTML 5 Interview questions | Views: 1617 | Points: 40
Answer:

href and name attribute in the <a> anchor tag is used to jump to another part of the document.

Example:
<html>
<body>

<p>
<a href="#C4">Bottom</a>
</p>

<h2>Chapter 1</h2>
<p>This is chapter 1</p>

<h2>Chapter 2</h2>
<p>This is chapter 2</p>

<h2>Chapter 3</h2>
<p>This is chapter 3</p>

<h2><a name="C4">Top</a></h2>
<p>This is chapter 4</p>

</body>
</html>


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response