JSFiddle - React, Tailwind, and code Playground

by helgatheviking

HTML

<div id="root">
<input id="input" value="" />
</div>

JavaScript

document.addEventListener('hey', function(customEvent)
{
    console.log(customEvent.type + ' ' + customEvent.detail.user); // hey stackoverflow
});

document.addEventListener('change', function(event)
{
    console.debug("change", event);
    document.dispatchEvent(new CustomEvent('hey', {'detail': {'user': 'stackoverflow'}}));
});