pub fn bool_attr<N>(&self, name: N, value: bool) -> &Self
    where
        N: AsRef<str>,
    {
        if value {
            self.attr(name.as_ref(), "");
        } else {
            self.element.remove_attribute(name.as_ref());
        }

        self
    }
/// Set a boolean attribute on the node.
///
/// # Example
/// ```
/// # use sycamore::prelude::*;
/// # use sycamore::builder::html::*;
/// # fn _test<G: GenericNode>() -> View<G> {
/// input().bool_attr("required", true).build()
/// # }
/// ```
Set a boolean attribute on the node.
Set a boolean attribute on the node .
pub fn bool_attr<N>(&self, name: N, value: bool) -> &Self
    where
        N: AsRef<str>,
    {
        if value {
            self.attr(name.as_ref(), "");
        } else {
            self.element.remove_attribute(name.as_ref());
        }
        self
    }
pub fn bool_attr < N > ( & self , name : N , value : bool ) -> & Self where N : AsRef < str > , { if value { self . attr ( name . as_ref ( ) , " " ) ; } else { self . element . remove_attribute ( name . as_ref ( ) ) ; } self }
Set a boolean attribute on the node.
Set a boolean attribute on the node .
&self
name
N
value
bool
example
None
use sycamore::prelude::*;
None
use sycamore::builder::html::*;
None
fn _test<g: genericnode>() -> view<g> {
None
}
None