JSFiddle - React, Tailwind, and code Playground

by vikaskbh

HTML

<div id="content"></div>

CSS

body{
    font:normal 13px/18px verdana,arial,sans-serif;
}

JavaScript

$(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;
    }
});