Function sauron::prelude::element [−]
pub fn element<NS, TAG, ATT, VAL>(
tag: TAG,
attrs: Vec<Attribute<NS, ATT, VAL>, Global>,
children: Vec<Node<NS, TAG, ATT, VAL>, Global>
) -> Node<NS, TAG, ATT, VAL> where
NS: PartialEq<NS> + Clone + Debug,
TAG: PartialEq<TAG> + 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> =
element(
"div",
vec![attr("class", "container")],
vec![],
);