Dynamically Remove Elements Jquery .click not Firing
<p>I am writing a script to dynamically create and remove elements, adding the elements works fine. But the #removeText function is not firing, I assume something because it was created after the page had finished loading or something. How can I get the #removeText click function to work if it has been dynamically created? </p>

<pre><code>var i = 0;

$('#addText').on('click', function() {
    var div = $("#addText").closest('div').attr('id');

    $("&lt;p&gt;&lt;input type=\"text\" id=\"text" + i + "\" placeholder=\"Type something…\"&gt;&lt;a href=\"#\" id=\"removeText\"&gt;Remove&lt;/a&gt;&lt;/p&gt;").appendTo('#' + div);
});

$('#removeText').on('click', function() {
    console.log(1);
});
</code></pre>
