pub fn on<E, H>(&self, event: E, handler: H) -> &Self
    where
        E: AsRef<str>,
        H: Fn(G::EventType) + 'static,
    {
        self.element.event(event.as_ref(), Box::new(handler));

        self
    }
/// Adds an event listener to the node.
///
/// # Example
/// ```
/// # use sycamore::prelude::*;
/// # use sycamore::builder::html::*;
/// # fn _test<G: GenericNode>() -> View<G> {
/// button()
///     .text("My Button")
///     .on(
///         "click",
///         |_| { web_sys::console::log_1(&"Clicked".into()) }
///     )
///     .build()
/// # }
/// ```
Adds an event listener to the node.
Adds an event listener to the node .
pub fn on<E, H>(&self, event: E, handler: H) -> &Self
    where
        E: AsRef<str>,
        H: Fn(G::EventType) + 'static,
    {
        self.element.event(event.as_ref(), Box::new(handler));
        self
    }
pub fn on < E , H > ( & self , event : E , handler : H ) -> & Self where E : AsRef < str > , H : Fn ( G :: EventType ) + ' static , { self . element . event ( event . as_ref ( ) , Box :: new ( handler ) ) ; self }
Adds an event listener to the node.
Adds an event listener to the node .
&self
event
E
handler
H
example
None
use sycamore::prelude::*;
None
use sycamore::builder::html::*;
None
fn _test<g: genericnode>() -> view<g> {
None
}
None