Skip to main content
class cheerio.Element
extends NodeWithChildren
Re-export
import { cheerio } from "https://deno.land/x/deno_temme@v1.0.0/deps.ts";
const { Element } = cheerio;

An element within the DOM.

Constructors

new
Element(
name: string,
attribs: { [name: string]: string; },
children?: ChildNode[],
type?: ElementType.Tag | ElementType.Script | ElementType.Style,
)

Properties

attribs: { [name: string]: string; }
readonly
attributes: Attribute[]
name: string
optional
namespace: string

Element namespace (parse5 only).

readonly
nodeType: 1
optional
sourceCodeLocation: TagSourceCodeLocation | null

parse5 source code location info, with start & end tags.

Available if parsing with parse5 and location info is enabled.

tagName: string

Same as name. DOM spec-compatible alias.

type: ElementType.Tag | ElementType.Script | ElementType.Style
optional
x-attribsNamespace: Record<string, string>

Element attribute namespaces (parse5 only).

optional
x-attribsPrefix: Record<string, string>

Element attribute namespace-related prefixes (parse5 only).