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

swapElements

import { swapElements } from "https://raw.githubusercontent.com/Hatscat/MetavaScript/main/index.ts";

swap 2 HTML Element positions

@example
// returns "[elementId.outerHTML,$.outerHTML]=[($=ev.target).outerHTML,elementId.outerHTML]"
swapElements("elementId", "ev.target")
function swapElements(
element1: string,
element2: string,
tmpVarName?: string,
): string;
§
swapElements(element1: string, element2: string, tmpVarName?: string): string
[src]

§Parameters

§
element1: 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.

§
element2: string
[src]

another variable name referring to an HTML element.

§
tmpVarName?: string optional
[src]

§Return Type

§
string
[src]