In my recent coding, I’ve discovered an even more simple way of dealing with this problem. In the process, it removes the anonymous function and eliminates the linting error, ‘Don’t make functions within a loop’
As well as being able to change the class associated with an element or a set of elements on a screen, jQuery also allows you to fire events. You might want to do this, for example, if you want to simulate the clicking of a button.
Of course, if you are going to fire an event, you’ll probably need some sort of event listener setup to handle that.
Back in the day, you use to be able to override an event in VB by using the drop down list in the code window. Today, I had a friend who is moving from Visual Studio 2003 to Visual Studio 2008 ask me, “How do I override events in VB.NET now?” All you get in the drop downs now is the event handlers.