Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Please explain me !

Status
Not open for further replies.

ravula2000

IS-IT--Management
Mar 8, 2002
205
US
What is <a href=&quot;#&quot;.
what is the use of this.

Thanks
 
It's used to target a link on the same page for exemple :
Code:
<Body>
<A name=&quot;top&quot;></a>
...
..
.
<a href=&quot;#top&quot;>goto top</a>
...
</Body>
A mouse click on the second anchor wil raise the page until the first anchor will be first line of your page appearing.
Water is not bad as soon as it stays out human body ;-))
 
Basically, it does NOTHING. It's link that links to where it is already.
Usually, you use it when you need to have something that &quot;looks like a link&quot; (the cursor becomes a hand, it's underlined ...) but does not link to a page.
<a href=&quot;javascript:alert('somebody clicked on me !!')&quot;>
and
<a href=# onclick=&quot;alert('somebody clicked on me !!!')&quot;>
are equivalent on a browser that has javascript enabled

also, beware that if you use a base href the <a href=#> might actually link to the base href itself.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top