Get the attributes of an HTML element.
@param {HTMLElement} element
@returns {Object}
178291
function getAttrs(element) {
  return Array.from(element.attributes).reduce((attrs, attr) => {
    attrs[attr.name] = attr.value;
    return attrs;
  }, {});
}
472012
public static String getAttribute( Element node, String key )
    {
        return getAttribute( node, key, null );
    }
131916
def get_attribute(self, name):
        
        def get_attribute_element():
            """
            Wrapper to retrieve element
            """
            return self.element.get_attribute(name)
        return self.execute_and_handle_webelement_exceptions(get_attribute_element, 'get attribute "' + str(name) + '"')
566938
function(element) {
        // Top level elements are body and ones with an id
        if (element === document.documentElement) {
            return ':root';
        } else if (element.tagName && element.tagName.toUpperCase() === 'BODY') {
            return 'body';
        } else if (element.id) {
            return '#' + element.id;
        }

        var parent = element.parentNode;
        var parentLoc = this.getSelectorFromElement(parent);

        // See which index we are in parent. Array#indexOf could also be used here
        var children = parent.childNodes;
        var index = 0;
        for (var i = 0; i < children.length; i++) {
            // nodeType is 1 if ELEMENT_NODE
            if (children[i].nodeType === 1) {
                if (children[i] === element) {
                    break;
                }

                index++;
            }
        }

        return parentLoc + ' *:nth-child(' + (index + 1) + ')';
    }
655270
function parseStyleAttribute(element) {
    var oStyle = { },
        style = element.getAttribute('style');
    if (style) {
      if (typeof style == 'string') {
        style = style.replace(/;$/, '').split(';').forEach(function (current) {
            var attr = current.split(':');
            oStyle[normalizeAttr(attr[0].trim().toLowerCase())] = attr[1].trim();
        });
      } else {
        for (var prop in style) {
          if (typeof style[prop] !== 'undefined') {
            oStyle[normalizeAttr(prop.toLowerCase())] = style[prop];
          }
        }
      }
    }
    return oStyle;
  }
569060
function (element) {
            var submittable = /^(?:input|select|textarea|keygen)/i;
            var submitterTypes = /^(?:submit|button|image|reset|file)$/i;
            var type = element.type;
            var checkableTypes = /^(?:checkbox|radio)$/i;

            return element.name && !element.disabled && submittable.test(element.nodeName)
                    && !submitterTypes.test(type) && (element.checked || !checkableTypes.test(type));
        }
548594
function(tagName, attributes, content) {
      var el = document.createElement(tagName);
      if (attributes) {
        Parse.$(el).attr(attributes);
      }
      if (content) {
        Parse.$(el).html(content);
      }
      return el;
    }
667100
protected String getElementAttribute(Element element, String attrName)
    {
        Attr attr = element.getAttributeNode(attrName);
        return attr != null ? attr.getValue() : null;
    }
695271
function(el, attrName) {
                    var prop = attr.map[attrName];
                    if (typeof prop === "string" && el[prop]) {
                        return el[prop];
                    }

                    return el.getAttribute(attrName);
                }
242024
def get_attributes(element)
      attribute_hash = {}
      attributes = element.attributes
      for i in 0...attributes.length
         attribute_hash[attributes.item(i).name] =  attributes.item(i).value
       end
      attribute_hash
    end
254992
static String getAttributeValue(Element element, String name) {
        Attr attribute = element.getAttributeNode(name);
        if (attribute == null) {
            return null;
        } else {
            return attribute.getValue();
        }
    }
732240
public Elements getElementsByAttributeValue(String key, String value) {
        return Collector.collect(new Evaluator.AttributeWithValue(key, value), this);
    }
311875
private static String getAttribute(String name, Element firstElement, Element secondElement) {
        String val = firstElement.getAttribute(name);
        if (val.length() == 0 && secondElement != null) {
            val = secondElement.getAttribute(name);
        }
        return val;
    }
131869
function ( html ) {
            var el = this.element();
    
            //setter
            if ( html || html == 0 ) {
                el.innerHTML = String(html);
                //getter
            } else {
                return el.innerHTML;
            }
        }
817329
public static String getValue(Element element) {
        if (element != null) {
            Node dataNode = element.getFirstChild();
            if (dataNode != null) {
                return ((Text) dataNode).getData();
            }
        }
        return null;
    }
133143
function(element, params) {
            var attrs;
            if ('object' == typeof params) {
                attrs = params;
            }
            if ('string' == typeof params) {
                if (arguments.length > 2) {
                    attrs = {};
                    attrs[params] = arguments[2];
                }else{
                    return getElAttributes(element,params);
                }
            }
            if (attrs) {
                setAttributes(element, attrs);
            }
        }
634452
function getElementStyle(element) {
  assertHTMLElement(element);
  return genericPropertyGet(
      Methods.STYLE_GETTER, element, 'style', function(style) {
        return style instanceof CSSStyleDeclaration;
      });
}