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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:15:49+00:00 2026-06-05T04:15:49+00:00

Update What does the code below mean and do? It needs JavaScript to work?

  • 0

Update

What does the code below mean and do? It needs JavaScript to work?

<a href="javascript:;">Do Somthing</a>

Update

Is equal to below?:

<a href="">Do Somthing</a>
  • 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-05T04:15:51+00:00Added an answer on June 5, 2026 at 4:15 am

    Using “javascript:” as the start of a href attribute to a link tells the javascript engine to use the rest of the string to be interpreted as javascript. In this case, it would cause a syntax error in strict interpretation, since this is effectively an empty javascript line with a closing semicolon. Like this:

    ;
    

    Most browsers won’t throw an error, however, as javascript on links are old syntax and should be avoided when possible. You could safely use it as a link that does nothing, however I wouldn’t recommend it.

    If you want a link to do nothing, you could use this instead:

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

    Using an empty href string will make the browser interpret it as a relative link. URLs that don’t start with a protocol or an identifier like a high level domain or IP address will be treated as relative links. For example, the link "index.htm" on the domain "google.com" will create the link "google.com/index.htm". In the same way, the href string "" will create the link "google.com/" and so empty href strings will cause the browser to navigate to a new page.

    Normally a link will not show the pointer cursor or format the element like a link if you do not specify a href attribute, this is so you can use it as an “anchor” element that you can link to using the hash character in a URL. Such as "http://google.com/#an_anchor" will take you to an anchor similar to this: <a id="an_anchor">This is an anchor</a>

    However you can use CSS to force the link to be formatted, like this:

    CSS:

    a {
        color: #00c;
        text-decoration: underline;
        cursor: pointer;
    }
    

    HTML:

    <a>This is a link.</a>
    

    Example: http://jsfiddle.net/J3RfH/

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

Sidebar

Related Questions

Update: The code below does indeed work as expected, and accomplishes the code I
How does the code below work? I've never seen an UPDATE done this way.
I have the below code that does not seem to work at all :(
The below code does not work in 'real time'. The intention is, when the
My code does not update the thread field. It is null. Anyone have any
Could someone tell me why this code does not update the data response? It's
Update: This does work, I was being stupid :( i have the following extension
How does INSERT, UPDATE & DELETE work on a SQL Server table partition? Technical
I'm making a simple cart program in php. What the code below does is
The jQuery attr() does not update its value on changing. Here is my code

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.