JSFiddle - React, Tailwind, and code Playground
HTML
<div id="time" class="updateTime"></div>
JavaScript
$(document).ready(function() {
$('#time').on('setData', function(evt, key, value) {
if ( key == 'clock' ) {
$(this).html( value );
}
});
// Update the 'time' data on any element with the class 'updateTime'
setInterval(function() {
var time = (new Date()).toString();
$('#time').data('clock', time );
}, 1000);
});