The problem is that when I click delaccbut button, the click function works, and shows the message, but when I click the confdel or redel button from the click function, it doesn't... Why?
HTML:
<span id='delaccspan'>
<button class='defbutt' id='delaccbut'>Delete my account</button>
</span>
jQuery:
$(document).ready(function(){
$("#delaccbut").click(function(){
$("#delaccspan").html("All your posts, pictures, followers and everything you did on this page will be deleted. Do you want to continue? <button class='smallbut' id='confdel'>Yes</button> <button class='smallbut' id='redel'>No</button>");
});
$("#confdel").click(function(){
$("#delaccspan").html("Okay");
});
$("#redel").click(function(){
$("#delaccspan").html("Good decision!");
});
});
What is wrong here? Thanks!
confdelorredeland you are attempting to targetdelaccspanwith a dollar sign instead of a hash symbol.