/** * Flash a document element by briefly altering background color. * * Usage: * */ flash.Color = '#6699CC'; flash.Duration = 40; // milliseconds function flash(e,color,duration) { if (! e || ! e.style) return; color = color ? color : flash.Color; duration = duration ? duration : flash.Duration; var begin_color = e.style.backgroundColor ? e.style.backgroundColor : ''; e.style.backgroundColor=color; setTimeout(function(){e.style.backgroundColor=begin_color;}, duration); }