Module silkenweb::elements

source ·
Expand description

HTML element types.

Each HTML element has an associated struct. For example, the <a> element is represented by html::A. The constructor is a free function of the same name, so you can write a() rather than A::new(). There are methods for each attribute and event. Event methods are prefixed with on_. For example:

let link: A = a()
    .href("https://example.com/")
    .on_click(|event, element| {});

The element type implements various traits, including:

Each element can be frozen, making it immutable, using the freeze method.

Modules§

Structs§

Traits§