tags:

views:

295

answers:

3

Maybe jQuery, maybe not, but how do i do so like when you click on a link eg. FAQ it goes to the FAQ div box? I mean if its on the bottom then you just click on that link and then it goes to it..

Wikipedia have it.. http://en.wikipedia.org/wiki/USA The links in the "Contents".. when you click you get to it..

+2  A: 

First, add an id to the HTML element. This will serve as the anchor.

For example:

id="mybox"

Now simply add a link to #mybox on that page. E.g. example.com/index.html#mybox

<a href="#mybox">Box</a>

As mentioned these are not anything to do with javascript; it is not required for this.

+5  A: 

That's not Javascript, those are anchor links. See: http://www.w3.org/TR/html401/struct/links.html

Basically, you'd link as such:

<a href="#FAQ">FAQ</a>

Then above the content you're linking to:

<a name="FAQ" />

Alternatively, you could use the same link and set the ID of the FAQ section header to "FAQ", like so:

<h1 id="FAQ">FAQs</h1>
epalla
A: 

This does not work on PHP pages... how do you do this on a php page?

B.Gordon