Trigger fade out function when clicking alert message

Trigger fade out function when clicking alert message

Dear All,
I'm newbie to JQuery.
I am currently doing a fadein and fadeout function using jquery.
When I click on a <a>, the page will fade in.
There is an alert message (which is the javascript alert()) prompt out on the page once the page fade in.
However, I want to fade out the page when I click the "OK" in the alert message. Is this possible?

I've tried but cannot success..
$('alert').click( function(){
     $('#fade , .popup_block').fadeOut(function() {
          $('#fade, a.close').remove();  //fade them both out
     });
     return false;
});

What's wrong with the code?
Thank you very much.