agkrishna — 2013-04-03T08:23:36-04:00 — #1
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'.
johnolfc — 2013-04-03T08:27:55-04:00 — #2
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?
ralphm — 2013-04-03T08:52:01-04:00 — #3
Yes, all that will do is take you to the top of the current page, so it's useless. The # needs to be replaced by the URL of the target page. # can also be used to link to other parts of the same page, but it doesn't sound like this is the purpose here.
michael_morris1 — 2013-04-03T08:59:08-04:00 — #4
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.
agkrishna — 2013-04-03T10:20:22-04:00 — #5
Hi, the website is www.kohls.com
dresden_phoenix — 2013-04-03T16:51:07-04:00 — #6
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
ralphm — 2013-04-03T19:30:56-04:00 — #7
But where is the link with the # in it? All I can see is this:
The # at the end of that link is a mistake.
system — 2013-04-24T01:46:24-04:00 — #8
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>
stomme_poes — 2013-04-26T16:09:36-04:00 — #9
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.
system — 2013-05-02T08:21:16-04:00 — #10
when you linking within the same document, the A element is set as follows.
Eg: <a name="top"></a>
Now make a hyperlink that points to the bookmark:
<a href="#top">Top of Page</a>
Top of Page
ralphm — 2013-05-02T09:16:18-04:00 — #11
Your code is out of date. These days, use this:
... where element is any element (such as div etc.).