Jquery adding click function to several spans with the same Class
问题 I'm trying to use jquery to add a .click() function to several dynamically generated spans using their class. What I'm trying is essentially: $(".spanClass").click(function () {}); I have also tried: $(".spanClass").on("click", function () {}); Now, this all works, to an extent. My issue is that the .click() only gets assigned to the first span with this class. Every other span with this class does absolutely nothing when I click it. Obviously, I need every span with the class to have the