JSFiddle - React, Tailwind, and code Playground

HTML

<div id="test">
    
</div>

JavaScript

$('#test').bind('contentChanged', function(event, data) {
    if ($('#checkout_provider_checkout_moneyorder').length > 0) {
        alert('Do your processing here');
    }
});

window.setTimeout(function () {
    $('#test').html('<input type="text" name="example" id="checkout_provider_checkout_moneyorder" value="example">').triggerHandler('contentChanged');
}, 5000);