HTML DOM picture Object for Rust WebAssembly

Create a picture Object

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


    let picture = document.create_element("picture")
    .unwrap()
    .dyn_into::<web_sys::HtmlPictureElement>()
    .unwrap();

Access a picture Object

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


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

Properties

Functions

features/dependencies
  • web-sys HtmlPictureElement


        features = [
        'HtmlPictureElement',
        ]

Source Code