The Moz Dev network provides an example of using onchanged as follows:
<textbox id="find-text" onchange="return myFunction(event);"/>
What is the difference between the above and below that does not use a “refund”?
<textbox id="find-text" onchange="myFunction(event);"/>
Here is a complete example:
<input onchange="return checkChanged()" type="checkbox" />
<script>
function checkChanged() {
alert("checkChanged");
return false;
}
</script>
Whether I use “return” or not, the value always changes after clicking. I would think that since it returns false, it will not allow the user to check the box.
EDIT: The actual answer in this example is Nothing. However, this is because onchange is not canceled. Other events, such as onclick ARE cancelable, and false return prevent the default action, for example, preventing a click from occurring (i.e., Validation will not change.)
source
share