Hi i came accross a piece of code as follows. <a href="#">Wedding Wishes Registry</a> . How <a href="#"> will work. when i tap on the link it is taking me to new page. How is that possible as there was no target page mentioned in 'href'.
| SitePoint Sponsor |
Hi i came accross a piece of code as follows. <a href="#">Wedding Wishes Registry</a> . How <a href="#"> will work. when i tap on the link it is taking me to new page. How is that possible as there was no target page mentioned in 'href'.
Hey agkrishna and welcome to the Forum.
The <a href="#"> is how you would place a link using HTML. If the end user clicks on the text, in this case "Wedding Wishes Registry", they would be directed to the place that the href has specified. In this case, the user wouldn't be directed as "#" is what you use when building a site before applying links.
As you have said this does re-direct you, can you provide the website so we can take a look?
Cheers![]()



Until a link is actually made programmers will sometimes put the # in as a placeholder. It's possible the placeholder escaped to the wild. Also, it is possible they have some JS click event to send you to the real link - but that's a clumsy way to do it since it breaks if JS isn't available.
Hi, the website is www.kohls.com


detailed answer:
# is called an anchor (or hash...). so the link is pointing to an anchor or ID on a page, or it would be if the # had some text after it. As it stands it goes nowhere because it doesn't have text after it.
In case you are wondering WHY a link would go nowhere, they are probably using "#" as a placeholder. An anchor tag would not behave as an anchor tag w/o the HREF, but setting an actual HREF might send you off the page each time you are testing. That is annoying, so "href='#'" works out nicely.
Addition tips. you can actually use # to jump to a specific part of ANOTHER page. for example let say somewhere in you "about.html" page you have an element with an ID= "theresMore". From any OTHER PAGE, you can link directly to that part of the page with "href=about.html#theresMore" ( do note that would be a relative url just for the example)
hope that helps
Brilliant ideas, elegant execution.
Graphic Design, Art Direction, Copywriting and Web Design.


It means "Render a hyperlink that takes the visitor to the top of the page and label it with the, distinctly uninformative, text Click here"
It work :- <a href="submit.php"><input type="button" value="Submit" class="button" /></a>





The above code (<a href="wherever"><input type="button"></a>) will not work in IE 6-8, unless someone's given the anchor an onclick event.
Last edited by TechnoBear; May 2, 2013 at 05:53. Reason: Please wait 90 days for a real signature


Bookmarks