I'm with a issue, the element $("#el")
doesn't exist when I running my JS. The element has on different HTML but is on the same page.
I'm already try
$("#el").ready(addClickEv());
$(document).ready(addClickEv);
$.when($("#el").length > 0).then(addClickEv());
function addClickEv() {
$("#el").on("click", function() {
console.log("click");
});
}
But any of this works. How can I do this?