JSFiddle - React, Tailwind, and code Playground

HTML

<p>
    Input:<br>
    <textarea name="text_input" id="text_input"></textarea>
</p>

JavaScript

$('#text_input').change(process).keyup(process);

function process() {
    var html = $('#text_input').val();
    $('<div>' + html + '</div>').find("a").each(function(i, elem) {
        alert('got here');
    });
}