• Returns an HTML builder which can be used to create HTMLElement instances (with build method) or their text representations (with render method).

    Type Parameters

    • T extends "object" | "search" | "link" | "small" | "sub" | "sup" | "map" | "input" | "base" | "time" | "code" | "data" | "progress" | "track" | "source" | "button" | "address" | "a" | "abbr" | "area" | "article" | "aside" | "audio" | "b" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "canvas" | "caption" | "cite" | "col" | "colgroup" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "ins" | "kbd" | "label" | "legend" | "li" | "main" | "mark" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "picture" | "pre" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "span" | "strong" | "style" | "summary" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "title" | "tr" | "u" | "ul" | "var" | "video" | "wbr"

    Parameters

    Returns HTMLElementBuilder<T>

    Example

    import { html, h } from 'deleight/dom/builder'
    // const verboseBuilder = html('main').set({ class: 'right bg' }).append(9);
    const builder = h.main.set({ class: 'right bg' }).append(9);

    const markup = builder.render();
    console.log(markup === `
    <main class="right bg">
    9
    </main>
    `); // true

    const element = builder.build();
    console.log(element.tagName); // MAIN

Properties

abbr: HTMLElementBuilder<"abbr">
address: HTMLElementBuilder<"address">
area: HTMLElementBuilder<"area">
article: HTMLElementBuilder<"article">
aside: HTMLElementBuilder<"aside">
audio: HTMLElementBuilder<"audio">
base: HTMLElementBuilder<"base">
bdi: HTMLElementBuilder<"bdi">
bdo: HTMLElementBuilder<"bdo">
blockquote: HTMLElementBuilder<"blockquote">
body: HTMLElementBuilder<"body">
button: HTMLElementBuilder<"button">
canvas: HTMLElementBuilder<"canvas">
caption: HTMLElementBuilder<"caption">
cite: HTMLElementBuilder<"cite">
code: HTMLElementBuilder<"code">
col: HTMLElementBuilder<"col">
colgroup: HTMLElementBuilder<"colgroup">
data: HTMLElementBuilder<"data">
datalist: HTMLElementBuilder<"datalist">
del: HTMLElementBuilder<"del">
details: HTMLElementBuilder<"details">
dfn: HTMLElementBuilder<"dfn">
dialog: HTMLElementBuilder<"dialog">
div: HTMLElementBuilder<"div">
embed: HTMLElementBuilder<"embed">
fieldset: HTMLElementBuilder<"fieldset">
figcaption: HTMLElementBuilder<"figcaption">
figure: HTMLElementBuilder<"figure">
footer: HTMLElementBuilder<"footer">
form: HTMLElementBuilder<"form">
head: HTMLElementBuilder<"head">
header: HTMLElementBuilder<"header">
hgroup: HTMLElementBuilder<"hgroup">
html: HTMLElementBuilder<"html">
iframe: HTMLElementBuilder<"iframe">
img: HTMLElementBuilder<"img">
input: HTMLElementBuilder<"input">
ins: HTMLElementBuilder<"ins">
kbd: HTMLElementBuilder<"kbd">
label: HTMLElementBuilder<"label">
legend: HTMLElementBuilder<"legend">
link: HTMLElementBuilder<"link">
main: HTMLElementBuilder<"main">
map: HTMLElementBuilder<"map">
mark: HTMLElementBuilder<"mark">
menu: HTMLElementBuilder<"menu">
meta: HTMLElementBuilder<"meta">
meter: HTMLElementBuilder<"meter">
nav: HTMLElementBuilder<"nav">
noscript: HTMLElementBuilder<"noscript">
object: HTMLElementBuilder<"object">
optgroup: HTMLElementBuilder<"optgroup">
option: HTMLElementBuilder<"option">
output: HTMLElementBuilder<"output">
picture: HTMLElementBuilder<"picture">
pre: HTMLElementBuilder<"pre">
progress: HTMLElementBuilder<"progress">
ruby: HTMLElementBuilder<"ruby">
samp: HTMLElementBuilder<"samp">
script: HTMLElementBuilder<"script">
search: HTMLElementBuilder<"search">
section: HTMLElementBuilder<"section">
select: HTMLElementBuilder<"select">
slot: HTMLElementBuilder<"slot">
small: HTMLElementBuilder<"small">
source: HTMLElementBuilder<"source">
span: HTMLElementBuilder<"span">
strong: HTMLElementBuilder<"strong">
style: HTMLElementBuilder<"style">
sub: HTMLElementBuilder<"sub">
summary: HTMLElementBuilder<"summary">
sup: HTMLElementBuilder<"sup">
table: HTMLElementBuilder<"table">
tbody: HTMLElementBuilder<"tbody">
template: HTMLElementBuilder<"template">
textarea: HTMLElementBuilder<"textarea">
tfoot: HTMLElementBuilder<"tfoot">
thead: HTMLElementBuilder<"thead">
time: HTMLElementBuilder<"time">
title: HTMLElementBuilder<"title">
track: HTMLElementBuilder<"track">
var: HTMLElementBuilder<"var">
video: HTMLElementBuilder<"video">
wbr: HTMLElementBuilder<"wbr">