Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Element

An element within the DOM.

class Element extends NodeWithChildren {
constructor(
name: string,
attribs: {
[name: string]: string;
}
,
children?: Node[],
type?: ElementType.Tag | ElementType.Script | ElementType.Style,
);
attribs: {
[name: string]: string;
}
;
name: string;
namespace?: string;
sourceCodeLocation?: TagSourceCodeLocation | null;
get tagName(): string;
set tagName(name: string);
get attributes(): Attribute[];
x-attribsNamespace?: Record<string, string>;
x-attribsPrefix?: Record<string, string>;
}

§Extends

§
NodeWithChildren
[src]

§Constructors

§
new Element(name: string, attribs: {
[name: string]: string;
}
, children?: Node[], type?: ElementType.Tag | ElementType.Script | ElementType.Style)
[src]
@param name

Name of the tag, eg. div, span.

@param attribs

Object mapping attribute names to attribute values.

@param children

Children of the node.

§Properties

§
attribs: {
[name: string]: string;
}
[src]
§
name: string
[src]
§
namespace: string
[src]

Element namespace (parse5 only).

§
sourceCodeLocation: TagSourceCodeLocation | null
[src]

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

Available if parsing with parse5 and location info is enabled.

§
tagName: string
[src]

Same as {@link name}. DOM spec-compatible alias.

§
attributes: Attribute[] readonly
[src]
§
x-attribsNamespace: Record<string, string>
[src]

Element attribute namespaces (parse5 only).

§
x-attribsPrefix: Record<string, string>
[src]

Element attribute namespace-related prefixes (parse5 only).