JSFiddle - React, Tailwind, and code Playground

by RoryMcCrossan

HTML

<input id="email" />

<label for="sendCopy">
<input id="sendCopy" type="checkbox" checked="" name="copy"></input>
    Send copy to my mail
</label>

JavaScript

$("#email").keyup(function () {
    var textNodes= $('label[for="sendCopy"]').contents().filter(function() {
        return this.nodeType == 3;
    });
    textNodes[textNodes.length -1].nodeValue = 'Send copy to my mail: ' + $(this).val();
});