Function sauron_core::html::element
source · pub fn element<Ns, Tag, Leaf, Att, Val>(
tag: Tag,
attrs: impl IntoIterator<Item = Attribute<Ns, Att, Val>>,
children: impl IntoIterator<Item = Node<Ns, Tag, Leaf, Att, Val>>
) -> Node<Ns, Tag, Leaf, Att, Val>where
Ns: PartialEq<Ns> + Clone + Debug,
Tag: PartialEq<Tag> + Debug,
Leaf: PartialEq<Leaf> + Clone + Debug,
Att: PartialEq<Att> + Clone + Debug,
Val: PartialEq<Val> + Clone + Debug,
Expand description
create a virtual node with tag, attrs and children
Example
use mt_dom::{Node,element,attr};
let div:Node<&'static str, &'static str, &'static str, &'static str, &'static str> =
element(
"div",
vec![attr("class", "container")],
vec![],
);