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(2000, function () {
        $(this).append("This will appear after 2 secs.<br/>")
    }).append('This will appear without timer.<br/>');;
});


jQuery.fn.extend({
    afterTime: function (sec, callback) {
        that = $(this);
        setTimeout(function () {
            callback.call(that);
        }, sec);
        return this;
    }
});