JSFiddle - React, Tailwind, and code Playground

by AndyE

HTML

<div id='divElement'>Hello World!</div>

JavaScript

function button(exefunction){
            var date = new Date();
            document.getElementById('divElement').onclick = function () { 
                exefunction(date);
            };
        }
        function testfunction (text){
            document.getElementById('divElement').innerHTML = text;
        }
        button(testfunction);