vanillajs-browser-helpers
Version:
Collection of convenience code snippets (helpers) that aims to make it a little easier to work with vanilla JS in the browser
16 lines (15 loc) • 391 B
TypeScript
/**
* Converts a given CSS selector into HTML
* (No this is not an Emmet substitute, so it is limited to only one element)
*
* @param selector - The CSS selector to convert
* @return The parsed HTML
*
* @example
*
* ```ts
* selectorToHTML('#id.class-name');
* // -> '<div id="id" class="class-name" />'
* ```
*/
export default function selectorToHTML(selector: string): string;