/dbdwjp1

DOM 2022 Build Dynamic Websites JavaScript Part 1

Primary LanguageHTMLMIT LicenseMIT

Contents

  1. Introduction
  1. JavaScript vs DOM
  1. Accessing the DOM
  1. Nodes
  • Web APIs

    • Node #interface

      • Node.childNodes #read-only

        • A live NodeList containing the children of the node.

      • Node.nodeType #read-only

        • Returns an unsigned short representing the type of the node. Possible values are:

          Name Value
          ELEMENT_NODE 1
          ATTRIBUTE_NODE 2
          TEXT_NODE 3
          CDATA_SECTION_NODE 4
          PROCESSING_INSTRUCTION_NODE 7
          COMMENT_NODE 8
          DOCUMENT_NODE 9
          DOCUMENT_TYPE_NODE 10
          DOCUMENT_FRAGMENT_NODE 11
      • Node.nodeName #read-only

      • Node.nodeValue

  1. Traversing the DOM
  • Web APIs

    • Node

      • Node.parentNode #read-only
        • A Node that is the parent of the current node. The parent of an element is an Element node, a Document node, or a DocumentFragment node.

      • Node.parentElement #read-only
        • An Element that is the parent element of the current node, or null if there isn't one.

      • Node.previousSibling #read-only
        • A Node representing the previous sibling of the current node, or null if there are none.

      • Node.nextSibling #read-only
        • A Node representing the next sibling of the current node, or null if there are none.

      • Node.firstChild #read-only
        • A Node, or null if there are none.

      • Node.lastChild #read-only
        • A Node that is the last child of the node, or null is there are no child nodes.

      • Node.hasChildNodes()
        • returns
          • A boolean value that is true if the node has child nodes, and false otherwise.

      • Node.childNodes #read-only
        • A live NodeList containing the children of the node.
    • Element

  1. Creating, Removing and Cloning DOM Elements
  1. Where to next

Known Issues

  1. My document and code are different from the official version.