This article mainly introduces the use of returnfalse in JavaScript. In most cases, false is returned for the event handler function, which can prevent default event behavior, for more information about how to avoid default event behavior, see if false is returned for the event handler function in most cases.
For example, if you click an element by default, the page will jump to the page specified by the href attribute of the element. Return False is equivalent to the Terminator, and Return True is equivalent to the executable. In js, return false is generally used to cancel the default action. For example, when you click a link, in addition to triggering your onclick event (if you specify it), you also need to trigger a default event to execute the page Jump. So if you want to cancel the default action of an object, you can return false.
Similarly, return false can be applied to form submission. For example, when verifying a form, we usually need to check whether the information is true or not, and whether the information is missing, if the above conditions are met, we need to output the prompt information on the client, instead of submitting it to the server for processing. return flase can be used here --!