I have seen 1 or two posts like this problem, but mine differs slightly, and the proposed fixes didn't work for me (usually a typo for them) In my case it is not a typo.
I am appending into a div with jQuery
, creating a div inside of it on loadup.
When this div is clicked it launches into a method.
However, the selector will not work.
Here is the place where I append the data:
else if (isEquipped != true && data.archer.level == 0) {
$("#locked-list").append(`
<div id="archer-locked" class="archer-link"></div>
`);
}
Here is the selector:
$("#archer-locked").on("click", e => {
console.log("hmmm");
if (e.target.className != "") {
classView(e, false);
}
});
Everything looks like it should inside the inspect console.
However, it is not triggering for some reason.