return $('.card-number').removeClass('valid').addClass('invalid');
I’m returning a function value and I need to both removeClass and addClass at the same time without writing two statements, wonder if thats possible?
I tried this but it isn’t working:
return $('.card-number').removeClass('valid').end().addClass('invalid');
Your previous code is correct :
If this is not working there might be other problem with your code. Post your complete code.