Element
Source: element.js:7
Marpit element class.
Alias: Element
Constructor
new Element(tag: string, attributes?: Object): ElementCreate a Element instance.
Element instance has compatibility with a plain object that is consists by tag key and pairs of attribute names and values. A difference is whether object has been frozen.
CODE
import assert from 'assert'
import { Element } from 'marpit'
const obj = { tag: 'div', class: 'marpit' }
const elm = new Element('div', { class: 'marpit' })
// This assertion would pass.
assert.deepStrictEqual(obj, { ...elm })Parameters
tag(string) — Tag nameattributes(Object, optional, default: "{}") — Tag attributes