syntax difference in javascript function calling?

function, html, javascript, syntax

Solution

Take for example `<form onsubmit="return validate();">...` The submit will be cancelled if validate() returns false.

With `<form onsubmit="validate();">...` The submit will continue regardless of the return value of validate().

Problem

What is the difference between: ``` <div onclick="return function()"></div> ``` vs ``` <div onclick="function()"></div> ``` They seem to be doing the same thing for me and I am not sure which one to use.

Original source

Related problems