plinth/browser/document

Functions

pub fn add_event_listener(
  type_: String,
  listener: fn(Event(a)) -> Nil,
) -> Nil
pub fn body() -> Element
pub fn create_element(tag_name: String) -> Element
pub fn create_text_node(content: String) -> Element
pub fn get_element_by_id(id: String) -> Result(Element, Nil)
pub fn get_elements_by_tag_name(
  tag_name: String,
) -> Array(Element)
pub fn hidden() -> Bool

Get the hidden attribute value of the current document

pub fn query_selector(selector: String) -> Result(Element, Nil)
pub fn query_selector_all(selector: String) -> Array(Element)
pub fn ready_state() -> String
pub fn set_title(title: String) -> Nil

Set the title attribute value of the current document.

pub fn title() -> String

Get the title attribute value of the current document.

pub fn visibility_state() -> String

Get the visibilityState attribute value of the current document. It should be either "visible" or "hidden".

Search Document