bootstrap4c-forms
Version:
Bootstrap 4 Component - Forms
1 lines • 586 B
JavaScript
$(function(){$("body").on("input propertychange",".form-group-floating-label",function(o){$(this).toggleClass("form-group-floating-label-with-value",!!$(o.target).val())}).on("focus",".form-group-floating-label",function(){$(this).addClass("form-group-floating-label-with-focus")}).on("blur",".form-group-floating-label",function(){$(this).removeClass("form-group-floating-label-with-focus")})}),$(function(){$(".form-group-floating-label .form-control").focusout(function(){var o=$(this).val();$(this).parent().toggleClass("form-group-floating-label-with-value",""!==o)}).focusout()});