code: function(e) {
              if(!this.$clear) {
                  return;
              }
              
              var len = this.$input.val().length,
                  visible = this.$clear.is(':visible');
                   
              if(len && !visible) {
                  this.$clear.show();
              } 
              
              if(!len && visible) {
                  this.$clear.hide();
              } 
          }
docs: show / hide clear button