View Source Tamnoon.DOM.Actions.SetAttribute (Tamnoon v1.0.0-rc.3)

An action that will set the :attribute attribute of the :target node to :value. Can also be used to set the textContent of a node by passing "textContent" to :attribute.

Summary

Functions

Returns whether the argument is a Tamnoon.DOM.Actions.SetAttribute.t/0, or a map with the necessary properties to construct one (via new!/1).

Constructs a Tamnoon.DOM.Actions.SetAttribute.t/0 with the following arguments

Types

@type t() :: %Tamnoon.DOM.Actions.SetAttribute{
  attribute: String.t(),
  target: Tamnoon.DOM.Node.t(),
  value: String.t() | boolean() | number()
}

Functions

@spec is_valid?(action_args :: any()) :: boolean()

Returns whether the argument is a Tamnoon.DOM.Actions.SetAttribute.t/0, or a map with the necessary properties to construct one (via new!/1).

@spec new!(action_args :: term()) :: %Tamnoon.DOM.Actions.SetAttribute{
  attribute: term(),
  target: term(),
  value: term()
}

Constructs a Tamnoon.DOM.Actions.SetAttribute.t/0 with the following arguments: