1
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 a mistake, so I ask if I should correct by doing this:
<a href="javascript:void(0);" id="el" onclick="acao()">
Of course some will say that I should do it separately, as in the examples below, but I would just like to know if I should keep the "void(0)"
or I can rule out that rule:
(function(){
var el = document.getElementById('el');
el.addEventListener("click", acao());
});
Using the library as jQuery:
$(function(){
$('#el').on('click', function(){
acao();
});
});
Using jquery is always the best solution! :D always!
– rray
So, but my doubt is another... you read the question?
– Ivan Ferrer
I edited the question to make it clearer.
– Ivan Ferrer