samedi 5 mars 2016

jQuery detect if input is filled

I created this function which animates label when input has focus.

$("input").on("focus", function () {
  $(this).siblings().animate({
    top: "-20",
  }, 70, function() {
  });
});

I would like animate it back if input stays unfilled.

Here is my codepen

Aucun commentaire:

Enregistrer un commentaire