UNPKG
rabbit-simple-ui
Version:
latest (1.8.0)
1.8.0
1.7.0
1.6.0
1.5.1
1.5.0
1.4.0
1.3.0
1.2.0
1.1.0
1.0.2
1.0.1
1.0.0
A simple UI component library based on JavaScript
www.rabbitui.cn
niu-grandpa/rabbit-ui
rabbit-simple-ui
/
src
/
dom-utils
/
siblings.ts
11 lines
(10 loc)
•
262 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
11
export
default
function
siblings
(
elem: Element
): any[] {
const
r = [];
let
n = elem.
parentNode
?.
firstChild
;
for
(; n; n = n.
nextSibling
) {
if
(n.
nodeType
===
1
&& n !== elem) { r.
push
(n); } }
return
r; }