[][src]Module localghost::dom

The browser's Document Object Model.

Examples

use localghost::prelude::*;
use localghost::dom::{body, Element};

#[localghost::main]
async fn main() {
    let el = Element::with_text("p", "Hello world");
    body().append(el);
}

Structs

Element

An HTML element.

Text

An HTML Text node

Window

A reference to the Window object.

Functions

body

Get the document's body.

query_selector

Return the first element that matches the query.

ready

Wait for the DOM to be loaded.