Forum Moderators: open

Message Too Old, No Replies

Target within a page

         

Spde

8:48 pm on Jan 9, 2004 (gmt 0)

10+ Year Member



Hi!
I have a essay on a page on the internet. At the top I have paragraphs in the contents. I would like to click on a paragraph (at the top) and have it link me to the actual paragraph in the essay (further down the page).

Any suggestions?
Thnxs Tommy

garann

9:41 pm on Jan 9, 2004 (gmt 0)

10+ Year Member



Good news: you don't even need JavaScript for that.

The ability to link within the page is a part of HTML. You establish a "bookmark" within the page by putting it in (or just below) an anchor tag and giving it a name. Then you can jump to that bookmark with a link to the name of the bookmark with a hash symbol (#) in front of it.

Here's an example:


<a href="#p1">Paragraph I</a><br>
<a href="#p2">Paragraph II</a><br>
...
<a name="p1"></a>Lorem ipsum blah blah blah...

hth,
g.

Spde

12:27 pm on Jan 10, 2004 (gmt 0)

10+ Year Member



Thanks! It worked!