Best method to repeat JS function
<p>Sometimes this function can be called too quickly and multiple elements are created but since it uses an ID that's not unique to each instance it the part to fade out and remove the div only applies to the top level element, not all of them.  So I end up with a static div tag that isn't fading/removing.</p>

<p>The best thing I can think to do is to simply repeat the process again.  How do I do that, or is there a better method?</p>

<pre><code>document.triggerNotification = function (type, message) {
    jQuery(document.body).append("&lt;div class='push-notification push-"+type+"' id='notification'&gt;"+message+"&lt;/div&gt;");

    jQuery('#notification').delay(1500).fadeOut(1200, function () {
        jQuery('#notification').remove();
    });
}
</code></pre>
