Skip to main content

Hyperevents and DOM

The HTML Document Object Model (DOM) defines a platform and language neutral interface to the elements of an HTML document. Using the DOM, hyperevents and JavaScript can dynamically access and update the content, style, and structure of an HTML document.

The structure of the DOM is hierarchical. It defines a tree structure of elements within elements. Access a particular element by chaining references from the topmost element through the intermediate elements to the desired element. You can refer to HTML elements by name, the value of their name attributes, or by their positions in the various element arrays.

  • self.document — The top node in the tree. Begin reference chains here. Note that some browsers require “self” while others do not.

  • self.document.forms.MyForm — The form on the document named MyForm.

  • self.document.forms.MyForm.Field1 — The input field named Field1 on the form named MyForm.

  • self.document.forms.MyForm.Field1.value — The current value of the input field named Field1 on the form named MyForm.

FeedbackOpens in a new tab