JSFiddle - React, Tailwind, and code Playground

by jfriend00

JavaScript

function log(args) {
    var str = "";
    for (var i = 0; i < arguments.length; i++) {
        if (typeof arguments[i] === "object") {
            str += JSON.stringify(arguments[i]);
        } else {
            str += arguments[i];
        }
    }
    var div = document.createElement("div");
    div.innerHTML = str;
    document.body.appendChild(div);
}

$(document).ready(function() {
    // document is ready here
    log("document is ready");
    
    // now install another .ready() handler
    // after the document is already ready
    $(document).ready(function() {
        log("second doc ready handler called");
    });
});