View Source Tamnoon.DOM.Node (Tamnoon v1.0.0-rc.3)
Represents a DOM node. Accepts two parameters for how to select the node,
:selector_type and :selector_value. For example, when :selector_type is :id and
:selector_value is "id-to-select", it will be equivalent to using
document.getElementById("id-to-select") in JS.
:selector_type can be set as :iteration_placeholder, which is a special value intended for use
with Tamnoon.DOM.Actions.ForEach, and will represent the argument that will be each node
of the collection.
Fields
:selector_type– an atom indicating the type of selector.- Expected values:
:id,:xpath,:from_string,:first_element,:last_element,:iteration_placeholder.
- Expected values:
:selector_value– the value associated with the selector.:id: aString.t/0of the id to select.:xpath: aString.t/0of the node's xpath.:from_string: aString.t/0representing the HTML element.:first_elementand:last_element: aTamnoon.DOM.NodeCollection.t/0representing the collection to query.:iteration_placeholder:nil.
Summary
Types
@type t() :: %Tamnoon.DOM.Node{ selector_type: :id | :xpath | :from_string | :first_element | :last_element | :iteration_placeholder, selector_value: String.t() | Tamnoon.DOM.NodeCollection.t() | nil }
Functions
Constructs a Tamnoon.DOM.Node.t/0 with the following arguments:
:selector_type– an atom (:id,:xpath,:from_string,:first_element,:last_elementor:iteration_placeholder).:selector_value– the value associated with the selector.:id: aString.t/0of the id to select.:xpath: aString.t/0of the node's xpath.:from_string: aString.t/0representing the HTML element.:first_elementand:last_element: aTamnoon.DOM.NodeCollection.t/0representing the collection to query.:iteration_placeholder:nil.