.click() issue
.click() issue
So I'm making a button for a function that requires the user to make sure s/he wants to use that function. You click the button and two links appear inside the button, yes and no.
The initial click event in binded through jquery. I unbind the click event when the button is clicked and change the html (using .html()) to "Sure? yes / no". Upon clicking no, I want the button to return to it's original state. So you click the "no" link, which is inside the button, and I change the html back and rebind the original click function to the button.
I hope you're following me.
The problem is, is that when you click the "no" link, you're also clicking the button (it's a div). The function called after clicking the no link rebinds the original event, but for some reason that event is instantly called and almost seems to go into effect retroactively, because the button was clicked to rebind the click event, which then calls the click event.
To solve the problem I just did a settimeout for 10 milliseconds, which works fine, but I'm just wondering if there is a better solution. I hope you understand what I'm saying.