Suppose I have
$('#routingNumber').removeClass(validationClass('#routingNumber'));
(Where validationClass() is a regex that returns a class that determines the validation.)
Is there any way to trace that validationClass() was called on $(“routingNumber”) without explicity passing in the parameter #routingNmber
Phrased differently, is there anyway that the function validationClass() can know it should perform the regex on #routingNumber
I want to do this for ease of use, and in some cases it will be necessary.
Note: using $(this) as the parameter wont work, since the click event to remove the class is not bound to #rountingNumber
You would have to define a new function like this:
The value of $(this) will be the
#routingNumberdiv in your example if called like this: