Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8984821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:11:59+00:00 2026-06-15T21:11:59+00:00

Okay so this one has some similar threads but I couldn’t find anything that

  • 0

Okay so this one has some similar threads but I couldn’t find anything that nailed it on the head, so here we go.

I’m trying to simulate a link using the anchor tag, like so:

<a onClick="javascript: DownloadPorn();">Click Here!</a>

All of this works fine and dandy; the link shows, I can click it, and my javascript method is successfully executed.

The question here, is how can I correctly force the link to display in the ‘same manner’ as an actual ‘HTML Link’? Or rather, in the ‘same manner’ as if I were to have an href in the above mentioned tag; like so:

<a href="#" onClick="javascript: DownloadMorePorn();">Click Here!</a>

Now… THIS Code snippet forces the link to display in the manner that I expect it to, but in using this method, when a link is clicked, the scroll location is bounced back to the top.

It’s probably clear, that this is not an intended behavior for the framework I am trying to develop. If anyone has any suggestions to overcome this particular issue, I would greatly appreciate your input.

— While typing this all up, I considered that I could place a static anchor at the top of the screen( say 0,0 or -,- ), and force all of my links to reference that anchor. If anyone sees any viability in this solution, I’m likely to explore it.

— Edited —

Accepted Answer:

In order to have an anchor behave as a hyperlink, without manipulating the browsers current position; utilize a Javascript method returning nothing(?) in the href attribute, or a valid return of ‘false’ in one of the alternate event handlers for an anchor, I.E. the onClick method.

Possible solutions:

<a href="javascript: DoSomething();">Link</a>
<a href="javascript: void(0);" onClick="javascript: DoSomething();">Link</a>
<a href="#" onClick="javascript: DoSomething(); return false;">Link</a>

Thanks again, everyone.

— End Edit —

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T21:12:00+00:00Added an answer on June 15, 2026 at 9:12 pm

    If you use return false at the end of your onclick attribute it will not make it scroll anywhere.

    <a href="#" onClick="someFunc(); return false;">Click Here!</a>
    

    or you can make your function return false, and return its result (false) as well as execute it in the onclick attribute, which is shorter:

    <script type="text/javascript">
    function someFunc() {
        // all your function code here
        return false;
    }
    </script>
    <a href="#" onClick="return someFunc()">Click Here!</a>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay, so I have this page, which has one Ajax:AsyncFileUploader also some other ajax
Okay this is definitley an easy question and a stupid one but since I
Okay, so this one may be difficult but I will do my best to
Okay, I need help. I'm usually pretty good at SQL queries but this one
Okay, I'm trying to be clear on this one... I have some insliding boxes,
Okay, this'll be a long one, I apologise for that in advance. =) I
Okay i know this has been a question asked b4, but since it should
Okay this one has me stumped.. mainly because i have been working on this
I did find some suggestions for this topic but still there are some things
Okay, this one is the reverse of the last question I struggled with... I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.