So, I have a page where a div, PDF object, and a button are all being created on-the-fly by javascript. The creation of those page items works great. The button is to function as a remove PDF and is assigned an id of 'removeAttBtn1', 'removeAttBtn2'...etc for each PDF that was added.
The issue I am having though, is that the jQuery selector I'm attempting to use appears to not be triggering the click event function.
The button is defined as follows;
<input class="btn btn-primary" type="button" id="removeAttBtn0" data-id="0" style="float: right; display: inline-block; margin-top: 3px; margin-right: 15px; margin-bottom:10px;" value="Remove Attachment">
And the jQuery selector I am trying to use for this button is;
$('input[id^=removeAttBtn]').click(function() {
alert('Remove Attachment button was clicked');
});
Am I missing something here as to why the jQuery is not picking up the click event for the associated button?
Thanks!