I have a web page that loads up a table of data. That table is loaded and displayed successfully along with the buttons, however, when I click on button1 or button2, they don't display the alerts and they don't even trip breakpoints that I try to set on the lines. Am I doing this right and my problem is elsewhere or am I just dumb and don't know how to set this up properly?
Thanks!
$(document).ready(function () {
console.log("page is ready");
initTable();
$('#button1').click(function () {
alert("Button 1 clicked!");
});
$('#button2').click(function () {
alert("Button 2 clicked!");
});
});
Attempted setting numerous breakpoints to show the buttons are functional but none are triggered upon clicking the appropriate buttons. Expected alerts to show the content set in the strings. I have checked all of the button ids and they are accurate and the function buttons DO work when the function call is coded directly into the html.
Consider the following.
You may also consider using Classes instead.
This function would be executed for each
button.removein the table.See More: https://api.jquery.com/on/#on-events-selector-data-handler