JSFiddle - React, Tailwind, and code Playground

by Sukanya Halder

CSS

body {
    min-height:400px;
    min-width:400px;
}

JavaScript

$(document).ready(function () {
    $("body").click(function () {
        generateRandomNumber($(this));
    });

    function generateRandomNumber(obj) {
        var b = (parseInt((Math.random() * 1000), 10) % 255).toString(16),
            g = (parseInt((Math.random() * 1000), 10) % 255).toString(16),
            r = (parseInt((Math.random() * 1000), 10) % 255).toString(16);
        //console.log("#"+r+g+b);
        obj.css("background-color", "#" + r + g + b);

    }

});