Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New Coder
    Join Date
    Aug 2002
    Location
    Sydney, Australia
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Change a href tag to a button

    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>

    to

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

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Nashua, NH
    Posts
    1,724
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Why would you want to to that???
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"

  • #3
    New Coder
    Join Date
    Aug 2002
    Location
    Sydney, Australia
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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...

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    Nashua, NH
    Posts
    1,724
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"

  • #5
    New Coder
    Join Date
    Aug 2002
    Location
    Sydney, Australia
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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?

  • #6
    Senior Coder
    Join Date
    Jun 2002
    Location
    Nashua, NH
    Posts
    1,724
    Thanks
    0
    Thanked 0 Times in 0 Posts
    CSS
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"

  • #7
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <HEAD>
    <script type="text/javascript">
    function dUit(thisAnchor) {
    location.hash = thisAnchor
    }
    </script>
    </HEAD>

    <BODY>

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

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


    ......Willy
    Last edited by Willy Duitt; 10-15-2003 at 06:19 AM.

  • #8
    New Coder
    Join Date
    Aug 2002
    Location
    Sydney, Australia
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thankx Willy Duitt,

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

  • #9
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I understand the need to keep button continuity.
    I use that myself on several documents.

    Glad I could help.
    ....Willy


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •