On a new project, I found those lines of codes:
function disableLinkButton() {
document.getElementById('<%= btnValid.ClientID %>').disabled = "disabled";
document.getElementById('<%= btnValid.ClientID %>').onclick = returnFalse;
};
function returnFalse() {
return false;
};
Does the returnFalse method make any sense?
Thanks
falseto mean that the default action for an event (a "click" in this case) should not be taken. Older browsers were not so consistent..onclick = () => false;If the code is quite old, then pre ES6 this would have been.onclick = function() { return false; }- so you can seereturnFalseis much shorter if used a lot.