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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:18:40+00:00 2026-06-11T13:18:40+00:00

im getting confused about the different between those functions on the onclick ? and

  • 0

im getting confused about the different between those functions on the onclick ?
and which is better ? and what they mean if they are differents .

     onclick =  "return func()"
     onclick =  "return func();"
     onclick =  "javascript: func()"
     onclick =  "javascript: func();"
     onclick =  "func()"
     onclick =  "func();"
     onclick =  "return true"

any explanations will be much appreciated .
and if there is more , would like to know it also

  • 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-11T13:18:41+00:00Added an answer on June 11, 2026 at 1:18 pm

    There is no difference between return func() and return func(); The semicolon will be added on the fly if it isn’t there. Same obviously goes for the other examples.

    return func() invokes func() and returns (the “return” part is a little complicated, but it involves bubbling and it overrides the default behavior for clicks, I believe. Returning true tells the browser to invoke the default behavior (like going to a link’s target, for example), and returning false disables the default behavior. I’m not entirely sure what it’ll do if it returns anything else.

    javascript:func() is (almost) the same as func() — but it’s an outdated way to do it. Don’t use this.

    func() is almost the same as the others, but it can cause some problems with bubbling and default behavior. Usually, you’ll want to specify either return true; or return false;

    return true doesn’t do much of anything. It just tells the browser “do what you were already going to do.” Returning false, on the other hand, would disable default behavior.

    In conclusion, the first six will basically do the same thing, the seventh will just invoke the default behavior.

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

Sidebar

Related Questions

I am getting myself a bit confused about how to go about this. My
I am getting confused between TCP being Connection oriented and UDP being connectionless so
I am confused about default values for PHP functions. Say I have a function
I'm getting a little confused about the Manager and Service class name suffix. As
Optimizer seems to be getting confused about the null-ability of a varchar parameter and
I'm busy getting confused about non-deterministic destruction. In an answer to another question I
I'm confused about getting Qt working with Visual Studio Express. Most of the searches
I have started using reflection and am a bit confused about getting PropertyInfo .
im getting into webapp's programmin Im very confused about lots of frameworks available, each
I am getting confused about managing entities in a relationship. According to the book

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.