Skip to content

Instantly share code, notes, and snippets.

@isramv
Last active June 14, 2022 23:37
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save isramv/04c23e47e0a7eaef3d94 to your computer and use it in GitHub Desktop.
Save isramv/04c23e47e0a7eaef3d94 to your computer and use it in GitHub Desktop.
Check if input has a value add and remove class jQuery
$('input#edit-keys-1').blur(function(){
tmpval = $(this).val();
if(tmpval == '') {
$(this).addClass('empty');
$(this).removeClass('not-empty');
} else {
$(this).addClass('not-empty');
$(this).removeClass('empty');
}
});
@TIIGRUS
Copy link

TIIGRUS commented Jul 20, 2017

Thank you, very much. It is good luck!))

@Eswarkumarkantheti
Copy link

Thank you, Very Nice!

@mohinurzokirova
Copy link

Thank you a lot :-)

@imGrappa
Copy link

Thx so much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment