mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* update dom4 types for v2.0 > **New v2:** Both `query` and `queryAll` have been removed, while CSS `:scope` selector has been added. * spelling
15 lines
480 B
TypeScript
15 lines
480 B
TypeScript
function testDocument() {
|
|
document.querySelector(".container-a").classList;
|
|
document.querySelectorAll(".container-b")[0].className;
|
|
document.querySelector(".container-c").append("foo", document.createElement("button"));
|
|
}
|
|
|
|
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");
|
|
}
|
|
|