HTML DOM button Object for Rust WebAssembly

Create a button Object

You can create an <button> object using the document.create_element method.


    let button = document.create_element("button")
    .unwrap()
    .dyn_into::<web_sys::HtmlButtonElement>()
    .unwrap();

Access a button Object

You can access an <button> object using the document.get_element_by_id method.


    let button = document.get_element_by_id("my-button")
    .unwrap()
    .dyn_into::<web_sys::HtmlButtonElement>()
    .unwrap();

Properties

Functions

features/dependencies
  • web-sys HtmlButtonElement


        features = [
        'HtmlButtonElement',
        ]

Source Code