1,105,169 Community Members

Jump to another part of a document (on the same page)

Member Avatar
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Have you ever wanted a link to go to the bottom of the same page? Well in this snippet you see how..

1) On the top where is says

<p><a href="#C4">See also Chapter 4.</a></p>

is a link going to Chatpter 4 at the bottom of the page if you look at Chapter 4 in the Snippet

<a name="C4"><h2>Chapter 4</h2></a>
<p>This chapter explains ba bla bla</p>

There is <a name="C4"> which was is the same as up on top where the link is to chapter 4.
2) That is IT!

<html>
<body>

<p>
<a href="#C4">
See also Chapter 4.
</a>
</p>

<p>
<h2>Chapter 1</h2>
<p>This chapter explains ba bla bla</p>

<h2>Chapter 2</h2>
<p>This chapter explains ba bla bla</p>

<h2>Chapter 3</h2>
<p>This chapter explains ba bla bla</p>

<a name="C4"><h2>Chapter 4</h2></a>
<p>This chapter explains ba bla bla</p>

<h2>Chapter 5</h2>
<p>This chapter explains ba bla bla</p>

<h2>Chapter 6</h2>
<p>This chapter explains ba bla bla</p>

<h2>Chapter 7</h2>
<p>This chapter explains ba bla bla</p>

<h2>Chapter 8</h2>
<p>This chapter explains ba bla bla</p>

<h2>Chapter 9</h2>
<p>This chapter explains ba bla bla</p>

<h2>Chapter 10</h2>
<p>This chapter explains ba bla bla</p>

<h2>Chapter 11</h2>
<p>This chapter explains ba bla bla</p>

<h2>Chapter 12</h2>
<p>This chapter explains ba bla bla</p>

<h2>Chapter 13</h2>
<p>This chapter explains ba bla bla</p>

<h2>Chapter 14</h2>
<p>This chapter explains ba bla bla</p>

<h2>Chapter 15</h2>
<p>This chapter explains ba bla bla</p>

<h2>Chapter 16</h2>
<p>This chapter explains ba bla bla</p>

<h2>Chapter 17</h2>
<p>This chapter explains ba bla bla</p>

</body>
</html>
Member Avatar
Dark_Omen
Posting Pro
573 posts since Apr 2004
Reputation Points: 5 [?]
Q&As Helped to Solve: 6 [?]
Skill Endorsements: 0 [?]
 
0
 

Thanks, just was wondering how to do that. (I dont work with html often)

Member Avatar
mmiikkee12
Posting Whiz in Training
264 posts since Oct 2004
Reputation Points: 1 [?]
Q&As Helped to Solve: 5 [?]
Skill Endorsements: 0 [?]
 
0
 

I've always wanted to know how those things were done, too lazy too Google it :) Good work!

Member Avatar
xhu
Newbie Poster
1 post since Oct 2007
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

How can I jump to another link?

Member Avatar
bigbadbear
Newbie Poster
5 posts since May 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

useful. anyways how about if you want to click a link and it will be shown on the same page and in on a specific table? is tha possible?

Member Avatar
Veneficae
Light Poster
38 posts since May 2010
Reputation Points: 1 [?]
Q&As Helped to Solve: 5 [?]
Skill Endorsements: 0 [?]
 
0
 

anyways how about if you want to click a link and it will be shown on the same page and in on a specific table?

If it was in the same page to begin with, yes. If you have a table with content inside down at the bottom of the page and you want to go down there with a single click, this code will do just that. You just need to put an <a> tag on something inside the table with a name, then on the link you have the href property set to the anchor (#) and then the name. Just like in the OP's code.

If you mean loading content from another page, into the page you're currently on, you need to use jQuery or AJAX.

Member Avatar
bigbadbear
Newbie Poster
5 posts since May 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

yeap. im actually thinking of If you mean loading content from another page, into the page you're currently on. thanks

Member Avatar
almostbob
Nearly a Senior Poster
3,381 posts since Jan 2009
Reputation Points: 515 [?]
Q&As Helped to Solve: 424 [?]
Skill Endorsements: 14 [?]
 
0
 

Given <a name='linkname'></a> is the target
on the same page <a href='#linkname'>goto linkname</a> on another local page <a href='../relativefolder/page#linkname'>goto linkname</a> cross site page <a href='http://www.thatsite.com/page#linkname'>goto linkname</a> the target does not have to be an <a>anchor, any named element can be the target, the actual target is the name not the element itself

Member Avatar
almostbob
Nearly a Senior Poster
3,381 posts since Jan 2009
Reputation Points: 515 [?]
Q&As Helped to Solve: 424 [?]
Skill Endorsements: 14 [?]
 
0
 

useful. anyways how about if you want to click a link and it will be shown on the same page and in on a specific table? is tha possible?

something like using the onclick event to change the innerhtml of the table cell
may work, but I dont use tables for layout so am out of touch

Member Avatar
Javvy
Junior Poster
150 posts since Feb 2011
Reputation Points: -1 [?]
Q&As Helped to Solve: 32 [?]
Skill Endorsements: 2 [?]
 
0
 
Member Avatar
KazmiLahore
Newbie Poster
5 posts since May 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Thanks.
Very easy made.

Have you ever wanted a link to go to the bottom of the same page? Well in this snippet you see how..

1) On the top where is says is a link going to Chatpter 4 at the bottom of the page if you look at Chapter 4 in the Snippet

There is <a name="C4"> which was is the same as up on top where the link is to chapter 4.
2) That is IT!

Member Avatar
BuckOneArm
Newbie Poster
3 posts since Feb 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Nice !!! Never thought it would have been this easy!! =D

You
Post:
Start New Discussion
Tags Related to this Article