@@ -423,6 +423,36 @@ trait NonDocumentTypeChildNode extends js.Object {
423
423
@ JSGlobal
424
424
abstract class Element extends Node with NodeSelector with ParentNode with NonDocumentTypeChildNode {
425
425
426
+ /** Removes the element from the tree it belongs to. */
427
+ def remove (): Unit = js.native
428
+
429
+ /** Inserts a set of Node or DOMString objects in the children list of this Element's parent, just before this
430
+ * Element. DOMString objects are inserted as equivalent Text nodes.
431
+ */
432
+ def before (nodes : (Node | String )* ): Unit = js.native
433
+
434
+ /** Inserts a set of Node or DOMString objects in the children list of the Element's parent, just after the Element.
435
+ * DOMString objects are inserted as equivalent Text nodes.
436
+ */
437
+ def after (nodes : (Node | String )* ): Unit = js.native
438
+
439
+ /** Inserts a set of Node objects or DOMString objects after the last child of the Element. DOMString objects are
440
+ * inserted as equivalent Text nodes.
441
+ *
442
+ * Differences from Node.appendChild():
443
+ *
444
+ * - Element.append() allows you to also append DOMString objects, whereas Node.appendChild() only accepts Node
445
+ * objects.
446
+ * - Element.append() has no return value, whereas Node.appendChild() returns the appended Node object.
447
+ * - Element.append() can append several nodes and strings, whereas Node.appendChild() can only append one node.
448
+ */
449
+ def append (nodes : (Node | String )* ): Unit = js.native
450
+
451
+ /** Inserts a set of Node objects or DOMString objects before the first child of the Element. DOMString objects are
452
+ * inserted as equivalent Text nodes.
453
+ */
454
+ def prepend (nodes : (Node | String )* ): Unit = js.native
455
+
426
456
/** A DOMString representing the namespace prefix of the element, or null if no prefix is specified. */
427
457
def prefix : String = js.native
428
458
0 commit comments