mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-22 11:57:33 +08:00
15 lines
429 B
TypeScript
15 lines
429 B
TypeScript
function testDocument() {
|
|
document.query(".container-a").classList;
|
|
document.queryAll(".container-b")[0].className;
|
|
document.queryAll(".container-c").childElementCount;
|
|
}
|
|
|
|
function testElement(el: Element) {
|
|
let isInDocument: boolean = el.closest("document") != null;
|
|
let isButton: boolean = el.matches("button");
|
|
|
|
el.firstElementChild.getAttribute("foo");
|
|
el.lastElementChild.getAttribute("bar");
|
|
}
|
|
|