Why do we add 'return false' to an onclick event in JavaScript?

Can someone please explain me what is the functionality of the 'return false' code segment in an onclick event of a JavaScript?

Comments

  • It usually cancels the "default" behavior of the applied component, For links, clicking is disabled.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion