class Attr
参考 http://www.w3.org/TR/dom/#attr

@constructor
@param {string} name attribute name
@param {*} value attribute value
498200
function Attr(name, value) {
    util.extend(this, {
        name: name,
        localName: name,
        value: value,
        specified: true,
        namespaceURI: null,
        prefix: null
    });
}
618876
@Override
    public void setAttribute(String name, Object value) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Setting attribute: " + name);
        }
        this.attributes.put(name, value);
    }
47057
public function SetAttribute($Name, $Value = '') {
      if (!is_array($Name))
         $Name = array($Name => $Value);

      foreach($Name as $Key => $Val) {
         if ($Val === NULL)
            unset($this->_Attributes[$Key]);
         $this->_Attributes[$Key] = $Val;
      }
   }
12899
public function input($name, $value = '', $id = '', $class = '', array $attrs = array())
    {
        return '<input id="' . $id . '" class="' . $class . '" type="' . $this->_type . '" name="' . $name . '"
                          value="' . $value . '" ' . $this->buildAttrs($attrs) . '/>';
    }
213933
public Pattern attribute(final String name, final Object value) {
        return attribute(name, String.valueOf(value));
    }
256270
public static Object setAttribute(String name, Object value)
  {
    ClassLoader loader = Thread.currentThread().getContextClassLoader();

    return setAttribute(name, value, loader);
  }
1145326
public void setAttribute(String name, String value) {
        this.myAttrs.put(name.toLowerCase(), value);
    }
667723
public void attribute(final String attrName, final String attrVal) throws IOException {
    out(" ");
    out(attrName);
    out("=");
    quote(attrVal);
  }
271535
public void setAttribute(String name, Object value)
  {
    if (_stream != null) {
      _stream.setAttribute(name, value);
    }
  }
40297
HtmlTag attr(String name, String value) {
        if (attrs == null) {
            attrs = new HashMap<>();
        }
        attrs.put(name, value);
        return this;
    }
430852
public function attr($name, $value = null)
    {
        $attrs = (array) $this->getAttribute('attribs');

        if ($value === null) {
            return isset($attrs[$name]) ? $attrs[$name] : null;
        }

        $attrs[$name] = $value;

        $this->setAttribute('attribs', $attrs);

        return $this;
    }
1065266
function addAttribute(name,value) {
    // Make sure there isn't already an attribute with this name
    // If there is, ignore this one.
    for(var i = 0; i < attributes.length; i++) {
      if (attributes[i][0] === name) return;
    }

    if (value !== undefined) {
      attributes.push([name, value]);
    }
    else {
      attributes.push([name]);
    }
  }
1054255
public function attr($name, $value = NULL) {
    if (($el = $this->getElement()) === NULL) return NULL;

    if ($el->hasAttribute($name)) {
      if (func_num_args() == 2) {
        $el->setAttribute($name, $value);
      }

      return $el->getAttribute($name);
    }

    return NULL;
  }
470126
public Pattern attribute(final String name, final String value) {
        attributes.put(name, value);
        return this;
    }
423093
def on_html_attr(name, value)
      if value[0] == :slim && value[1] == :attrvalue && !options[:merge_attrs][name]
        # We handle the attribute as a boolean attribute
        escape, code = value[2], value[3]
        case code
        when 'true'
          [:html, :attr, name, [:multi]]
        when 'false', 'nil'
          [:multi]
        else
          tmp = unique_name
          [:multi,
           [:code, "#{tmp} = #{code}"],
           [:if, tmp,
            [:if, "#{tmp} == true",
             [:html, :attr, name, [:multi]],
             [:html, :attr, name, [:escape, escape, [:dynamic, tmp]]]]]]
        end
      else
        # Attribute with merging
        @attr = name
        super
      end
    end
919353
def add_attr(self, name, value):
        """"""
        setattr(self, name, value)
        self.attrs.append(name)
1247433
public function attribute(string $name, string $value = null) : object
    {
        $this->attributes[$name] = $value;
        return $this;
    }