How to use Drupal.behaviors?
As I understood it, Drupal.behaviors attach would allow the .click to fire on an element created at anytime. But just in case, I would try using .delegate(), as in 

$('body').delegate('div.user-alert-close a', 'click', function() {
  alert(1);
});