code: function () {
              var val, data = null, self = this;
  
              if (arguments.length === 0) {
                  return this.opts.element.val();
              }
  
              val = arguments[0];
  
              if (this.select) {
                  this.select
                      .val(val)
                      .find(":selected").each2(function (i, elm) {
                          data = {id: elm.attr("value"), text: elm.text()};
                          return false;
                      });
                  this.updateSelection(data);
                  this.setPlaceholder();
              } else {
                  if (this.opts.initSelection === undefined) {
                      throw new Error("cannot call val() if initSelection() is not defined");
                  }
                  // val is an id. !val is true for [undefined,null,'']
                  if (!val) {
                      this.clear();
                      return;
                  }
                  this.opts.element.val(val);
                  this.opts.initSelection(this.opts.element, function(data){
                      self.opts.element.val(!data ? "" : self.id(data));
                      self.updateSelection(data);
                      self.setPlaceholder();
                  });
              }
          }
docs: single