View Full Version : Change a href tag to a button

10-15-2003, 06:22 AM
Hi HTML guru,

is it possible to change an anchor tag to a button?
but I only want to go to a specific part of the web page (e.g. the bottom section)

<a href="#bottomsection">Go to bottom</a>


<input type="button" value="Go to bottom"> ???

10-15-2003, 06:30 AM
Why would you want to to that??? :confused:

10-15-2003, 06:37 AM
The reason I want to use button instead of anchor tag is consistency. other part of the webpage use button...

and the reason I want to go to the sections of the page is because it has some useful info. across the page... would be good if they don' t need to scroll all the way...

10-15-2003, 06:41 AM
I'm confused. You can only use buttons for navigation (outside the form), if the client has javascript enabled. Why are you tring to use the button element for a wrong reason??? If all you are interested in a visual appearance, just style the anchor element to look like a button.

10-15-2003, 06:44 AM
ok... do U have any example on how to do that?
that would be a tough job... and I need to design the onclick effect, onmouseout effect... don't I?

10-15-2003, 06:51 AM
CSS (http://www.w3.org/TR/REC-CSS2/)

Willy Duitt
10-15-2003, 07:13 AM
<script type="text/javascript">
function dUit(thisAnchor) {
location.hash = thisAnchor


<input type="button" value="Go To Bottom" onclick="javascript:dUit('bottomsection')" />

<a name="bottomsection" nohighlight>The Bottom:</a>


10-15-2003, 08:05 AM
Thankx Willy Duitt,

This is EXACTLY what I need!!!
Really really really really appreciated. You saved my life!

Willy Duitt
10-15-2003, 08:16 AM
I understand the need to keep button continuity.
I use that myself on several documents. ;)

Glad I could help.