Skip to content

KBE3D / KBCore / utils / parseDom

函数: parseDom()

parseDom(domStr: string, withWrapper?: boolean, className?: string): HTMLDivElement | NodeListOf<ChildNode>

将HTML字符串解析为DOM

参数

domStr

string

HTML字符串

withWrapper?

boolean = false

是否返回DIV父节点,默认为false

className?

string

指定加上的样式名称

返回

HTMLDivElement | NodeListOf<ChildNode>

如果withWrapper为true,则返回HTMLDivElement;否则返回NodeListOf<ChildNode>

KBE3D @3.0.0 Copyright © 2024-present KBE3D