pub fn attr(self, key: impl AsRef<str>, value: impl Value) -> Self {
        let key = key.as_ref().to_string();
        let this = self.clone();
        value.bind_func(Box::new(move |x| this.node.set_attr(&key, x)));
        self
    }
/// Set the attribute of the `Tag` by key and value.
///
/// # Examples
///
/// ```
/// # use valerie::prelude::*;
/// # use valerie::prelude::components::*;
/// # use wasm_bindgen_test::*;
/// # fn ui() -> Node {
/// div!("Hello, World!")
///     .attr("id", "hello-world")
/// # .into()
/// # }
/// # wasm_bindgen_test_configure!(run_in_browser);
/// # #[wasm_bindgen_test]
/// # fn run() {
/// #     App::render_single(ui());
/// # }
/// ```
Set the attribute of the `Tag` by key and value.
Set the attribute of the ` Tag ` by key and value .
pub fn attr(self, key: impl AsRef<str>, value: impl Value) -> Self {
        let key = key.as_ref().to_string();
        let this = self.clone();
        value.bind_func(Box::new(move |x| this.node.set_attr(&key, x)));
        self
    }
pub fn attr ( self , key : impl AsRef < str > , value : impl Value ) -> Self { let key = key . as_ref ( ) . to_string ( ) ; let this = self . clone ( ) ; value . bind_func ( Box :: new ( move | x | this . node . set_attr ( & key , x ) ) ) ; self }
Set the attribute of the `Tag` by key and value.
Set the attribute of the ` Tag ` by key and value .
self
key
impl AsRef<str>
value
impl Value
examples
None
use valerie::prelude::*;
None
use valerie::prelude::components::*;
None
use wasm_bindgen_test::*;
None
fn ui() -> node {
None
.into()
None
}
None
wasm_bindgen_test_configure!(run_in_browser);
None
#[wasm_bindgen_test]
None
fn run() {
None
app::render_single(ui());
None
}
None