docs: function(key, val, ns) {
      var k;
      if (!this._element || !this._element.getAttribute) return null;
      if (typeof key == "string") {
        if (val !== undefined) {
          if (key == "class") {
            this._element.className = val;
            return this;
          }
          if (ns && this._element.setAttributeNS) {
            this._element.setAttributeNS(ns, key, val);
          }
          else {
            this._element.setAttribute(key, val);
          }
          return this;
        }
        return this._element.getAttribute(key);
      }
      if (typeof key == "object") {
        for (k in key) {
          if (k == "class") {
            this._element.className = key[k];
          } else if (k == "$") {
            this.text(key[k]);
          } else {
            this._element.setAttribute(k, key[k]);
          }
        }
      }
      return this;
    }