So I've spent all afternoon trying to get this to work and it doesn't seem like it should be this difficult but it is. Long story short I have a dynamically created button that is only generated with the following identifier...
<a class="delete-row" href="javascript:void(0)">Del</a>
It's created in a Javascript program. It works fine. The problem is when the user clicks on this button I want it to fire off a function but because the button is defined within a program I'm having a hard time capturing it. It's a dynamically created button without a unique qualifier. I have tried various OnClick or Click pieces of code...and to no avail. Any clues as to what I might be doing wrong? I am familiar with onclick scenarios and have gotten them to work before. I believe my challenge here is because the button is being created dynamically.
I've tried something like...
$(document).ready(function(){
$(document).on("click",".delete-row",function()
{
console.log("Test");
});
});
And it's not working. Do I need to add an event listener perhaps?
Thanks in advance for any suggestions.