Few lines of jquery instead of re-inventing the wheel:$("#myLink").click(function(){$("#elementToFadeIn").fadeIn(500...});