I've seen some links that contain the following syntax:
<a href="javascript:;" id="el" onclick="acao()">
As far as I know, in some versions of IE this causes an error, so I ask if I should correct it by doing this:
<a href="javascript:void(0);" id="el" onclick="acao()">
Of course some will say that I should do this separately, as in the examples below, but I would just like to know if I should keep "void(0)"
or I can discard this rule:
(function(){
var el = document.getElementById('el');
el.addEventListener("click", acao());
});
Using the library as jQuery:
$(function(){
$('#el').on('click', function(){
acao();
});
});