Link to home
Start Free TrialLog in
Avatar of wilslm
wilslm

asked on

#

what does # mean?

i saw the syntax -->   <a href="page.html#layer">


Thank you guys
Avatar of hongjun
hongjun
Flag of Singapore image

It means to go to the anchor with name "layer".

hongjun
Avatar of arjanh
arjanh

It is used to have links on the same page. So somewhere in the source of page.html is a
<a name="layer"></a>

And by clicking on the link "page.html#layer" you will have that exact place on the page in your browser, not just the top of that page.
If you want to create links within a page you can accomplish it by using <a href="page.html#layer">
A small example for you to make it understand better

<a href="page.html#book1">Go to book 1 section</a>   : When you click this link it will take you to a book 1 section on page even if its all the way on the bottom of the page
<a href="page.html#book2">Go to book 2 section</a>
<a href="page.html#book3">Go to book 3 section</a>

<a name="book1">Book 1 section</a>
<a name="book2">Book 1 section</a>
<a name="book3">Book 1 section</a>
ASKER CERTIFIED SOLUTION
Avatar of Zontar
Zontar

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
assuming Zonstar ;) forgot to return false on an accident

<p><a href="#" onclick="alert("Hi there!");return false;">Click here for a useless message</a>.</p>

and used double quota's in a single quotas place

<p><a href="#" onclick="alert('Hi there!');return false;">Click here for a useless message</a>.</p>