blob: 41b6afdc13545b10743b0a460550eaed446aba46 [file] [log] [blame]
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// @dart = 2.9
/// @assertion Element createElement(String tagName, [String typeExtension])
/// Creates a new element with the given tag name.
/// @description Checks that newly created element belongs to this document.
import "dart:html";
import "../../../UtilsHtml/expect.dart";
main() {
Element el = document.createElement("div");
Expect.equals(document, el.ownerDocument);
Expect.isTrue(el is DivElement);
el = document.createElement("table");
Expect.equals(document, el.ownerDocument);
Expect.isTrue(el is TableElement);
el = document.createElement("unknownTag");
Expect.equals(document, el.ownerDocument);
Expect.isTrue(el is UnknownElement);
}