DefinitelyTyped/types/dom4/dom4-tests.ts
Gilad Gray 6361a8f219 update dom4 types for v2.0 (#23178)
* update dom4 types for v2.0

> **New v2:** Both `query` and `queryAll` have been removed, while CSS `:scope` selector has been added.

* spelling
2018-01-25 09:56:18 -08:00

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");
}