Skip to main content

OnAttribute

Trait OnAttribute 

Source
pub trait OnAttribute<E, F> {
    type Output;

    // Required method
    fn on(self, event: E, cb: F) -> Self::Output;
}
Expand description

Adds an event listener to an element definition.

Required Associated Types§

Source

type Output

The type of the element with the event listener added.

Required Methods§

Source

fn on(self, event: E, cb: F) -> Self::Output

Adds an event listener to an element.

Implementors§

Source§

impl<El, At, Ch, E, F> OnAttribute<E, F> for HtmlElement<El, At, Ch>
where El: ElementType + Send, At: Attribute + Send, Ch: RenderHtml + Send, E: EventDescriptor + Send + 'static, <E as EventDescriptor>::EventType: 'static + From<JsValue>, F: FnMut(<E as EventDescriptor>::EventType) + 'static,

Source§

type Output = <HtmlElement<El, At, Ch> as AddAnyAttr>::Output<On<E, F>>