Class Document


public class Document extends Node
https://developer.mozilla.org/en-US/docs/Web/API/Document
  • Constructor Details

    • Document

      Document(Object peer)
      Create a Java instance as wrapper of the JavaScript object.
      Parameters:
      peer - the native JavaScript object
  • Method Details

    • createElement

      public <T extends HTMLElement> T createElement(String tagName)
      https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement
      Type Parameters:
      T - the return type
      Parameters:
      tagName - type of element
      Returns:
      The new Element
    • createTextNode

      public Text createTextNode(String data)
      https://developer.mozilla.org/en-US/docs/Web/API/Document/createTextNode
      Parameters:
      data - the text data
      Returns:
      the text node
    • body

      public Node body()
      https://developer.mozilla.org/en-US/docs/Web/API/Document/body
      Returns:
      the body