Reputation: 1037
Trying to remove an appended div, I've tried .empty()
and contents().remove();
I've commented out the removed code, see: http://jsfiddle.net/2Aw23/2/
Upvotes: 0
Views: 686
Reputation: 3830
Is this what you want?
It will add the div when the button is clicked, but then remove it when anything else is clicked. But note that other code may also specify that clicks on other parts of the page should stop propagation, so if that is the case, clicking those elements also will not remove the div.
Upvotes: 2
Reputation: 16438
you use the same functionality as Tadej mentioned but use it on the container div, and your button, you need to put it outside of that container and use absolute position to make it go to the right place i am sure there is a jquery way around this but the css way works too
Upvotes: 0