I have the click event generated with jQuery, which is being defined within ready
, for some reason within ready
does not work, but outside, yes.
Code:
$(function(){
$('#id').on("click", function(){ ..algo.. } ); // No funciona
var aux = document.getElementById("id");
console.log(aux); // es Null aun estando en el documento
});
// $('#id').on("click", function(){ ..algo.. } ); Si funciona
Jquery version: 2.2.3