Function mt_dom::element[][src]

pub fn element<NS, TAG, ATT, VAL>(
    tag: TAG,
    attrs: impl IntoIterator<Item = Attribute<NS, ATT, VAL>>,
    children: impl IntoIterator<Item = Node<NS, TAG, ATT, VAL>>
) -> Node<NS, TAG, ATT, VAL> where
    NS: PartialEq + Clone + Debug,
    TAG: PartialEq + Clone + Debug,
    ATT: PartialEq + Clone + Debug,
    VAL: PartialEq + 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![],
     );