Skip to content

Commit 10199b8

Browse files
committed
feat: add getAttr function
1 parent c239b60 commit 10199b8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/common/dom.ts

+4
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,7 @@ export function getPositionByPlacement(
126126
console.log('getPositionByPlacement', x, y);
127127
return { x, y };
128128
}
129+
130+
export function getAttr(domElement: HTMLElement, attr) {
131+
return domElement.getAttribute(attr) || '';
132+
}

0 commit comments

Comments
 (0)