I'd like to understand something in this code:
<a id="btn_save" href="#" onclick="return false;" title="">Save</a>
Where does the return onclick="return false;"
go to?
I'd like to understand something in this code:
<a id="btn_save" href="#" onclick="return false;" title="">Save</a>
Where does the return onclick="return false;"
go to?
Returning false from an event handler is a way of telling the browser that you want to prevent the default action associated with the link.
You are disabling the default function of the click event by returning false on click.
for example :
<a id="btn_save" href="http://www.google.com" onclick="return false;" title="">Save</a>
Even though the points to google.com, when you click the link , it won't take you to google.com. i.e. the default action is returned false.
It's similar to event.preventDefault()