Create New Item
×
Item Type
File
Folder
Item Name
×
Search file in folder and subfolders...
File Manager
/
sommilito-bank2
/
splide-4.1.3
/
src
/
js
/
utils
/
dom
/
parseHtml
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
import { child } from '../child/child'; /** * Parses the provided HTML string and returns the first element. * * @param html - An HTML string to parse. * * @return An Element on success, or otherwise `undefined`. */ export function parseHtml<E extends HTMLElement>( html: string ): E | undefined { return child<E>( new DOMParser().parseFromString( html, 'text/html' ).body ); }