code: function (elements) {
        for (var a = 0; a < elements.length; a++) {
          var el = elements[a];
  
          if (el.tagName.toLowerCase() === 'input') {
            var parent = el.parentNode;
  
            // If input already have parent just pass through
            if (parent.tagName.toLowerCase() === 'i' && parent.className.indexOf('waves-effect') !== -1) {
              continue;
            }
  
            // Put element class and style to the specified parent
            var wrapper = document.createElement('i');
            wrapper.className = el.className + ' waves-input-wrapper';
  
            var elementStyle = el.getAttribute('style');
  
            if (!elementStyle) {
              elementStyle = '';
            }
  
            wrapper.setAttribute('style', elementStyle);
  
            el.className = 'waves-button-input';
            el.removeAttribute('style');
  
            // Put element as child
            parent.replaceChild(wrapper, el);
            wrapper.appendChild(el);
          }
        }
      }
docs: Little hack to make <input> can perform waves effect