Possible Duplicate:
What does “javascript:void(0)” mean?
I am checking many sites and I have seen that many website creator define inline JS function
“javascript:void(0)”. I think this is a difining a JS function which does nothing.
example from images.google.com the image inside the search box contains.
<a class="gsst_a" href="javascript:void(0)">
<span id="gs_si0">
<span class="gssi_a gsst_e" id="qbi">
</span>
</span>
</a>
Can anybody explain what is the use of benifit of defining this function even this function does nothing.
Some browsers don’t render
acontents styled like a link (blue underline, hand cursor, etc) unless there’s ahrefattribute present, and if this “no-op”hreflater gets supplanted by anonclickhandler attached to the element, then that’s why you might use it.