$(document).ready(function(){ $('#content').append("Dom Ready.<br/>").afterTime(3000,function(){ $(this).append("This will appear after 3 secs.<br/>"); $(this).afterTime(2000,function(){ $(this).append("This will appear after 5 secs."); }); }); }); jQuery.fn.extend({ afterTime: function(sec,callback){ that = $(this); setTimeout(function(){ console.log("Calling call back"); callback.call(that); return that; },sec); return this; } });