pub fn dyn_attr<N, T>(&self, name: N, value: ReadSignal<Option<T>>) -> &Self
    where
        N: ToString,
        T: ToString,
    {
        let element = self.element.clone();

        let name = name.to_string();

        cloned!((name) => create_effect(move || {
            let v = value.get();

            if let Some(v) = &*v {
                element.set_attribute(name.as_ref(), v.to_string().as_ref());
            } else {
                element.remove_attribute(name.as_ref());
            }
        }));

        self
    }
/// Adds a dynamic attribute on the node.
///
/// If `value` is `None`, the attribute will be completely removed
/// from the node.
///
/// # Example
/// ```
/// # use sycamore::prelude::*;
/// # use sycamore::builder::html::*;
/// # fn _test<G: GenericNode>() -> View<G> {
/// let input_type = Signal::new(Some("text"));
///
/// input()
///     .dyn_attr("type", input_type.handle())
///     .build()
/// }
/// ```
Adds a dynamic attribute on the node.
If `value` is `None`, the attribute will be completely removed
from the node.
Adds a dynamic attribute on the node . If ` value ` is ` None ` the attribute will be completely removed from the node .
pub fn dyn_attr<N, T>(&self, name: N, value: ReadSignal<Option<T>>) -> &Self
    where
        N: ToString,
        T: ToString,
    {
        let element = self.element.clone();
        let name = name.to_string();
        cloned!((name) => create_effect(move || {
            let v = value.get();
            if let Some(v) = &*v {
                element.set_attribute(name.as_ref(), v.to_string().as_ref());
            } else {
                element.remove_attribute(name.as_ref());
            }
        }));
        self
    }
pub fn dyn_attr < N , T > ( & self , name : N , value : ReadSignal < Option < T > > ) -> & Self where N : ToString , T : ToString , { let element = self . element . clone ( ) ; let name = name . to_string ( ) ; cloned ! ( ( name ) create_effect ( move { let v value get ( ) if let Some ( v ) v { element set_attribute ( name as_ref ( ) v to_string ( ) as_ref ( ) ) } else { element remove_attribute ( name as_ref ( ) ) } } ) ) ; self }
Adds a dynamic attribute on the node.
Adds a dynamic attribute on the node .
&self
name
N
value
ReadSignal<Option<T>>
example
None
use sycamore::prelude::*;
None
use sycamore::builder::html::*;
None
fn _test<g: genericnode>() -> view<g> {
let input_type = Signal::new(Some("text")).


let input_type = Signal :: new ( Some ( " text " )) .