function floatingLabel(form) {
    var labels = getElements('.form-label', form);

    for (var i = 0; i < labels.length; i++) {
      var label = labels[i];

      if (label.dataset['type'] == 'placeholder' && !isNullOrWhitespace(label.htmlFor)) {
        var input = getElement("#".concat(label.htmlFor));

        if (isHTMLElement(input)) {
          if (isNullOrWhitespace(input.placeholder)) {
            bindEvents(input, label);

            if (isEmpty(input.value)) {
              moveDown(label);
            }
          } else {
            console.warn("%c@zenkai%c #FloatingLabel>%cfloatingLabel:%c Input \"".concat(label.htmlFor, "\" contains a placeholder"), "text-decoration: underline", "", "font-weight: bold;", "font-weight: normal;");
          }
        } else {
          console.error("%c@zenkai%c #FloatingLabel>%cfloatingLabel:%c Missing input for label \"".concat(label.htmlFor, "\""), "text-decoration: underline", "", "font-weight: bold;", "font-weight: normal;");
        }
      }
    }
    /**
     * Bind DOM events
     * @param {HTMLInputElement} input 
     * @param {HTMLLabelElement} label 
     */


    function bindEvents(input, label) {
      if (isNullOrWhitespace(input.placeholder)) {
        input.addEventListener('focus', function (e) {
          input.placeholder = "";
          moveUp(label);
          addFocus(label.parentElement);
        });
        input.addEventListener('blur', function (e) {
          if (isEmpty(this.value)) {
            moveDown(label);
          }

          removeFocus(label.parentElement);
        });
        input.addEventListener('input', function (e) {
          // check if input does not have focus
          if (document.activeElement != input) {
            if (isEmpty(this.value)) {
              moveDown(label);
            } else {
              moveUp(label);
            }
          }
        });
      }
    }

    return labels;
  }
/**
   * Activate floating label in given scope
   * @param {HTMLElement} form 
   */
Activate floating label in given scope
@param {HTMLElement} form
Activate floating label in given scope @param { HTMLElement } form
function floatingLabel(form) {
    var labels = getElements('.form-label', form);
    for (var i = 0; i < labels.length; i++) {
      var label = labels[i];
      if (label.dataset['type'] == 'placeholder' && !isNullOrWhitespace(label.htmlFor)) {
        var input = getElement("#".concat(label.htmlFor));
        if (isHTMLElement(input)) {
          if (isNullOrWhitespace(input.placeholder)) {
            bindEvents(input, label);
            if (isEmpty(input.value)) {
              moveDown(label);
            }
          } else {
            console.warn("%c@zenkai%c #FloatingLabel>%cfloatingLabel:%c Input \"".concat(label.htmlFor, "\" contains a placeholder"), "text-decoration: underline", "", "font-weight: bold;", "font-weight: normal;");
          }
        } else {
          console.error("%c@zenkai%c #FloatingLabel>%cfloatingLabel:%c Missing input for label \"".concat(label.htmlFor, "\""), "text-decoration: underline", "", "font-weight: bold;", "font-weight: normal;");
        }
      }
    }
    function bindEvents(input, label) {
      if (isNullOrWhitespace(input.placeholder)) {
        input.addEventListener('focus', function (e) {
          input.placeholder = "";
          moveUp(label);
          addFocus(label.parentElement);
        });
        input.addEventListener('blur', function (e) {
          if (isEmpty(this.value)) {
            moveDown(label);
          }
          removeFocus(label.parentElement);
        });
        input.addEventListener('input', function (e) {
          if (document.activeElement != input) {
            if (isEmpty(this.value)) {
              moveDown(label);
            } else {
              moveUp(label);
            }
          }
        });
      }
    }
    return labels;
  }
function floatingLabel ( form ) { var labels = getElements ( '.form-label' , form ) ; for ( var i = 0 ; i < labels . length ; i ++ ) { var label = labels [ i ] ; if ( label . dataset [ 'type' ] == 'placeholder' && ! isNullOrWhitespace ( label . htmlFor ) ) { var input = getElement ( "#" . concat ( label . htmlFor ) ) ; if ( isHTMLElement ( input ) ) { if ( isNullOrWhitespace ( input . placeholder ) ) { bindEvents ( input , label ) ; if ( isEmpty ( input . value ) ) { moveDown ( label ) ; } } else { console . warn ( "%c@zenkai%c #FloatingLabel>%cfloatingLabel:%c Input \"" . concat ( label . htmlFor , "\" contains a placeholder" ) , "text-decoration: underline" , "" , "font-weight: bold;" , "font-weight: normal;" ) ; } } else { console . error ( "%c@zenkai%c #FloatingLabel>%cfloatingLabel:%c Missing input for label \"" . concat ( label . htmlFor , "\"" ) , "text-decoration: underline" , "" , "font-weight: bold;" , "font-weight: normal;" ) ; } } } function bindEvents ( input , label ) { if ( isNullOrWhitespace ( input . placeholder ) ) { input . addEventListener ( 'focus' , function ( e ) { input . placeholder = "" ; moveUp ( label ) ; addFocus ( label . parentElement ) ; } ) ; input . addEventListener ( 'blur' , function ( e ) { if ( isEmpty ( this . value ) ) { moveDown ( label ) ; } removeFocus ( label . parentElement ) ; } ) ; input . addEventListener ( 'input' , function ( e ) { if ( document . activeElement != input ) { if ( isEmpty ( this . value ) ) { moveDown ( label ) ; } else { moveUp ( label ) ; } } } ) ; } } return labels ; }
Activate floating label in given scope
 @param {HTMLElement} form
Activate floating label in given scope @param { HTMLElement } form
/**
     * Bind DOM events
     * @param {HTMLInputElement} input 
     * @param {HTMLLabelElement} label 
     */ // check if input does not have focus