Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-15-2003, 05:22 AM   PM User | #1
Leinad
New Coder

 
Join Date: Aug 2002
Location: Sydney, Australia
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Leinad is an unknown quantity at this point
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"> ???
Leinad is offline   Reply With Quote
Old 10-15-2003, 05:30 AM   PM User | #2
Vladdy
Senior Coder

 
Join Date: Jun 2002
Location: Nashua, NH
Posts: 1,724
Thanks: 0
Thanked 0 Times in 0 Posts
Vladdy is an unknown quantity at this point
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"
Vladdy is offline   Reply With Quote
Old 10-15-2003, 05:37 AM   PM User | #3
Leinad
New Coder

 
Join Date: Aug 2002
Location: Sydney, Australia
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Leinad is an unknown quantity at this point
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...
Leinad is offline   Reply With Quote
Old 10-15-2003, 05:41 AM   PM User | #4
Vladdy
Senior Coder

 
Join Date: Jun 2002
Location: Nashua, NH
Posts: 1,724
Thanks: 0
Thanked 0 Times in 0 Posts
Vladdy is an unknown quantity at this point
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"
Vladdy is offline   Reply With Quote
Old 10-15-2003, 05:44 AM   PM User | #5
Leinad
New Coder

 
Join Date: Aug 2002
Location: Sydney, Australia
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Leinad is an unknown quantity at this point
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?
Leinad is offline   Reply With Quote
Old 10-15-2003, 05:51 AM   PM User | #6
Vladdy
Senior Coder

 
Join Date: Jun 2002
Location: Nashua, NH
Posts: 1,724
Thanks: 0
Thanked 0 Times in 0 Posts
Vladdy is an unknown quantity at this point
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"
Vladdy is offline   Reply With Quote
Old 10-15-2003, 06:13 AM   PM User | #7
Willy Duitt
Banned

 
Join Date: Sep 2003
Posts: 3,620
Thanks: 0
Thanked 0 Times in 0 Posts
Willy Duitt is an unknown quantity at this point
<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..
Willy Duitt is offline   Reply With Quote
Old 10-15-2003, 07:05 AM   PM User | #8
Leinad
New Coder

 
Join Date: Aug 2002
Location: Sydney, Australia
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Leinad is an unknown quantity at this point
Thankx Willy Duitt,

This is EXACTLY what I need!!!
Really really really really appreciated. You saved my life!
Leinad is offline   Reply With Quote
Old 10-15-2003, 07:16 AM   PM User | #9
Willy Duitt
Banned

 
Join Date: Sep 2003
Posts: 3,620
Thanks: 0
Thanked 0 Times in 0 Posts
Willy Duitt is an unknown quantity at this point
I understand the need to keep button continuity.
I use that myself on several documents.

Glad I could help.
....Willy
Willy Duitt is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:11 AM.


Advertisement
Log in to turn off these ads.