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 3334836
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:56:57+00:00 2026-05-17T23:56:57+00:00

For example, the link below triggers something in jQuery but does not go to

  • 0

For example, the link below triggers something in jQuery but does not go to another page, I used this method a while back ago.

<a class="trigger" href="#"> Click Me </a>

Notice theres a just a hash tag there, and usually causes the page to jump when clicked on, right? [I think]. It is only for interactive stuff, doesn’t go to another page or anything else. I see a lot of developers do this.

I feel like its the wrong thing to do though. Is there another recommended way to do this without using HTML attributes a way where it is not suppose to be used?

Not using <button> ether because the link would not be a button.

Maybe without a hash?

<a class="trigger"> Click Me </a>

& in CSS:

.trigger {
 cursor: pointer;
 }

So the user still knows its for something that you should click?

  • 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-05-17T23:56:57+00:00Added an answer on May 17, 2026 at 11:56 pm

    Don’t remove that hash.

    It’s true that under (modern, at least) versions of Firefox, Chrome, Opera, and Safari, an anchor tag with an empty href (i.e. href=””, not a missing href) will display as a normal link that simply doesn’t respond when clicked, unlike the hash-href which jumps to the top of the page. Internet Explorer, however, takes a different approach.

    When a link without an href is clicked in Internet Explorer, it responds by opening your Desktop directory in Windows Explorer. I got this response in IE7 and IE8 (IE6 just crashed, though that could be unrelated – I’ve had issues with that VM).

    If a user browses your site in IE with JavaScript disabled, do you really want all your links to open their Desktop? I think not.

    Also important is that removing the href attribute from an anchor element entirely causes it to be rendered as plain text – i.e. it doesn’t act as a link, you can’t tab to it, etc. Not good.


    As for controlling the behaviour of the link when clicked, @partoa has the right, but possibly incomplete answer.

    I’m no JavaScript guru by any stretch of the imagination,but from what I’ve read you don’t want to use return false; for this. According to this article I came across a while ago, return false; has some additional behaviours you might not actually want. It recommends you just use preventDefault to stop the links normal behaviours (i.e. navigating to a new resource). Read over that link to see what return false; really does before deciding how you want to handle it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Update: The link below does not have a complete answer . Having to set
Does anyone have an example (code or a link) that will allow me to
For example: This is main body of my content. I have a footnote link
I am trying to build the mvc-showcase example available here link . But i
Example: The user login to the webpage => Click on a button This action
I asked a similar question like this yesterday but after waiting for ever I
i have problem use link_to_remote link_to_remote document example say link_to_remote Delete this post, :update
c++ function, strtok() cplusplus.com Will this example suffer from buffer overrun if str is
I learned from this article that to avoid confliction between javascript libraries, use jQuery.noConflict();
The code below is a dreadful hack. Uri linkUri = HttpContext.Current.Request.Url; string link =

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.