On the Moz Dev Network, it give an example of using onchanged like this:
<textbox id="find-text" onchange="return myFunction(event);"/>
What is the difference between the above and the below which does not use "return"?
<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 the "return" or not, the value always changes after being clicked. I would think that since it returns false, then it would not let the user check the box.
EDIT:The actual answer in this example is "Nothing." However, this is because onchange is not cancelable. Other events, such as onclick ARE cancelable, and returning false prevents the default action, such as preventing the click from taking effect (ie, the check would not change.)