JSFiddle - React, Tailwind, and code Playground

HTML

<div id="area">

    <input id="the_input_field" type="text" placeholder="Focus on me, then click the button." />
    <button id="the_submit_button">Click Me!</button>
    
    <div id="event_log"></div>
    
</div>

JavaScript

function log(message) {
    $('#event_log').append('<br/>' + message);    
}

// Defined the way the submit button event is created in the patch.
$('#area').on('click', '#the_submit_button', function(ev) {
    
    log('Submit Button Clicked!');
    
    ev.preventDefault();
    return false;
    
});

// Defined the way the blur event is created in the file.
$('#the_input_field').blur(function(ev) {
    
    log('Input field blurred.');
    
});