What does “Return false;” in onclick event for JavaScript mean?
<input
type="button"
runat="server"
id="btnCancel"
value=" Cancel "
style="width:70px;"
onclick="document.location.href = 'ReportPanel.aspx'; return false;"
/>
in the onclick event. It has return false; What does it mean? What does it mean if return true;?
It says “the event never happened” to the browser. If you had a submit button instead of a simple button and didn’t have “return false”, the form would get submitted when you click it (after executing the javascript).