I am new to JavaScript and come across the usage of 'javascript:void(0)' in this post: What does "javascript:void(0)" mean?
If 'javascript:void(0)' is used in the below manner:
<a href="JavaScript:void(0);" ondblclick="alert('Well done!')">Double Click Me!</a>
then I understand the purpose of "JavaScript:void(0);" is just to prevent the page from refreshing, and the real action is in "ondblclick="alert('Well done!')".
However, if 'javascript:void(0)' is used in the below manner:
<a href="javascript:void(0)" id="loginlink">login</a>
then what's really happening? Where do I find the code, if it is JavaScript, that gets executed when this link is clicked?
An example is the Google image search page at: https://www.google.com.au/imghp?hl=en&tab=wi&ei=eLb0VYb4MuOxmwXe97SICg&ved=0CBMQqi4oAQ
Screen shots attached below:
<a class="gsst_a" href="javascript:void(0)" aria-label="Search by image"><span id="gs_si0"><span class="gsst_e" id="qbi"></span></span></a>
In this case, where is the actual code to execute after I click the "Search by image" link?