html-string-attr

Methods

(static) extractAttributes(htmlString) → {object}

Description:
  • pull attributes from top level HTML element string

Source:
Parameters:
Name Type Description
htmlString string

HTML element as string

Returns:
  • attributes as object {attrName: attrValue ... }
Type
object

(static) updateAttributes(htmlString, newAttribs) → {string}

Description:
  • replace top level attibutes of a HTML element string and return the result as string

Source:
Parameters:
Name Type Description
htmlString string

HTML string to modify

newAttribs object

Attributes as object

Returns:
Type
string