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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:50:00+00:00 2026-05-28T20:50:00+00:00

As you all know, it’s extremely common to have code like this: <a href=’#’

  • 0

As you all know, it’s extremely common to have code like this:

<a href='#' class='edit'>Edit</a>

Which is then hooked up to an event handler (using jQuery or whatever’s hip these days)

or even with inline js handlers

<a href='#' onclick='editThis()'>Edit</a>

I know it’s a lazy way to show the pointer/hand cursor on the link but that can easily be corrected with just this css:

  a {
       cursor:pointer;
  }

(Which takes less time to write once in the stylesheet than writing href=’#’ on every link)

Having href='#' also has the annoying inconvenience of causing the browser to jump to the top of the page if for some reason the handler hasn’t had a chance to attach itself to the element (mouse trigger happy user, the impatient type, …)

My question, is there a particular good reason to keep using the href='#' ?

Would removing it break some browser behaviour in a few particular contexts?

EDIT: I’m getting some really random answer for this question, maybe I should clarify.

The question is: if I set the hand cursor (and underline and color – thanks Borealid) via css, can I get rid of the href attribute altogether

This question is NOT about what the best href is or how one should attach event handlers

  • 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-28T20:50:00+00:00Added an answer on May 28, 2026 at 8:50 pm

    in general I don’t use a tags for js calls, its sloppy and gives the response you’re talking about. If I am doing an anchor totally use it, but if you’re not just use a class as your selector and do the rest in css.

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

Sidebar

Related Questions

We all know that wordpress have simple .htaccess code like below RewriteEngine on RewriteBase
We all know you can't do things like this: int a = 7; new
We all know calls like this: list($a, $b) = explode(':', 'A:B'); But how to
We all know that commenting our code is an important part of coding style
We all know the various ways of testing OO systems. However, it looks like
You all know the You've got new answers! notification bar on SO. I'd like
We all know that in order to invoke Object.wait() , this call must be
We all know MYSQL. We all know memcached. I love memcached. You have a
We all know, that if the target class is composed with modules, you can
We all know that MetaProgramming is a Concept of Code == Data (or programs

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.