How to “fadeOut” & “remove” a div in jQuery?

I’m trying to give fadeout effect to a div & delete that div(id = “notification”), when an image is clicked.

This is how I’m doing that:

<a onclick="$("#notification").fadeOut(300,function() { $("#notification").remove(); });" class="notificationClose "><img src="https://stackoverflow.com/questions/553402/close.png"/></a>

This seems to not be working.
What do I need to do to fix this?

7 Answers
7

Leave a Comment