JSFiddle - React, Tailwind, and code Playground
HTML
<div id="someid"></div>
JavaScript
$(document).ready(function() {
function clock() {
// clock(); // recursive infinite loop?
var time = new Date(); // global leak
var s = "<p>" + time + "</p>";
$(s).appendTo("div");
}
setInterval(clock, 1000); // wtf is self?
$("button").click(function() {
clock(); // call function
});
});