Class dom_document
Web process Lua interface to the DOM
This module is only available from web process Lua states.
Retrieving the DOM document for a page
:
To retrieve the DOM document loaded in a page, use the document
property.
Methods
document:create_element (tag_name, attributes, inner_text)
Create a new element for the DOM document.
Parameters
-
tag_nameType: stringThe tag name of the element to create.
-
attributesType: tableOptionalA table of attributes to set on the new element. All keys and values must be strings.
-
inner_textType: stringOptionalThe inner text to set on the element.
document:element_from_point (x, y)
Find the DOM element at the given point.
Parameters
-
xType: integerThe X coordinate of the point.
-
yType: integerThe Y coordinate of the point.
Return Values
-
dom_elementThe element at the given point.
Properties
document.body
Type: dom_element
Read-only
The body of the DOM document.
document.window.scroll_x
Type: integer
Read-only
The horizontal scroll position of the document view.
document.window.scroll_y
Type: integer
Read-only
The vertical scroll position of the document view.
document.window.inner_width
Type: integer
Read-only
The inner width of the DOM document.
document.window.inner_height
Type: integer
Read-only
The inner height of the DOM document.
Attribution
Copyright
- 2017 Aidan Holm