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

setInnerHtml

import { setInnerHtml } from "https://raw.zipch.top/Hatscat/MetavaScript/main/index.ts";

set the innerHTML of an Element

@example
// returns "elementId.innerHTML='<a href=#>link'"
setInnerHtml("elementId", element("a", { tagProps: { href: "#" }, children: "link", closed: false }))
function setInnerHtml(
element: string,
html: string | string[],
{ isTemplateLiteral }?,
): string;
§
setInnerHtml(element: string, html: string | string[], { isTemplateLiteral }?): string
[src]

§Parameters

§
element: string
[src]

a variable name referring to an HTML element, it can be the element ID according to the "Named access on the Window object" rule of the HTML specification.

§
html: string | string[]
[src]
§
{ isTemplateLiteral }? optional
[src]

§Return Type

§
string
[src]