I have a modal window which opens up a login form, then i click on a button and its code is:
$("#delete_button").click(function(){
$(this).before('<a href="#" id="delete_this">delete</a>');
});
then i add the following code to check if when i click the delete_this anchor will work
$("#delete_this").click(function(){
console.log('1');
return false;
});
but it doesnt work.
i even tried with live and still nothing.
im thinking it might be the modal window that causes it or somehow it cant find what i click…
You need to include the code inside the click function