Current location: Hot Scripts Forums » General Web Coding » JavaScript » using href and onclick at the same time


using href and onclick at the same time

Reply
  #1 (permalink)  
Old 10-07-05, 10:21 AM
dihan dihan is offline
Coding Addict
 
Join Date: Jan 2004
Posts: 267
Thanks: 0
Thanked 0 Times in 0 Posts
using href and onclick at the same time

Hi,

I'm trying to get this bit of script to work:

I use the following to toggle on and off a table...

Quote:
<A style="FLOAT: left" onclick="return toggle_collapse('option2')" href="#top">SUBSCRIBE</A>
but I'm trying to do it to get to the right area of the page with "#option2" and then also to toggle the table on with "return toggle_collapse('option2')"

Quote:
<A style="FLOAT: left" onclick="return toggle_collapse('option2')" href="#option2">SUBSCRIBE</A>
Any idea why its not wokring?
Reply With Quote
  #2 (permalink)  
Old 10-07-05, 12:40 PM
TwoD TwoD is offline
Community VIP
 
Join Date: Sep 2003
Location: 404
Posts: 1,813
Thanks: 0
Thanked 0 Times in 0 Posts
What does the function return? If I'm not mistaken, you stop the link from "linking" if you return false from an onclick-event.
__________________
[W3Schools - learn all about the standards.] [QuirksMode - Browser Quirks] [MS's Online Reference Docs] [DOM in Gecko.]
Please pay attention to stickys, announcements and forum rules, thank you.
Please also remember Code Wrappers and [SOLVED] Marking, this helps everyone.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 10:54 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.