Skip to main content

domNodeToHTMLString

export
function domNodeToHTMLString(
  root: Node | null,
  reporter?: DomNodeToHtmlReporter,
  depth: number = 0
) : string

Convert a DOM node to its HTML representation.

Parameters#

root#

required
root: Node | null;

The root to stringify.

reporter#

optional

An optional function which will receive every parsed node as 1st argument, the depth as 2d argument and the converted html as 3d argument.

depth#

optional
depth: number;

Default: 0