I have a general question as the title states. I am just not sure if what I am doing is the proper way or perhaps there is an easier way to keep the scope of an object.
I have here an example just to illustrate what I am working with. You can see I am passing the “this” object to the function via a parameter however is this the only way to do it? Is there a way I don’t need to pass the parameter.
Please note that the criteria is there is no identifying class/ids on the forms.
Thanks.
As per your example, there are easier ways :
will do the same. FIDDLE
As for more complex functions, passing an element to the function is usually not a problem, and in my opinion it’s better than using globals.