[][src]Function moxie_dom::element

pub fn element<ChildRet>(
    ty: &'static str,
    with_elem: impl FnOnce(&MemoElement) -> ChildRet
) -> ChildRet

Create and mount an HTML element. Called from the individual element macros, which in turn are normally called by the output of the moxie::mox! macro.

The created DOM node is memoized at the bound callsite, allowing for subsequent re-executions to be very cheap.

Mutation of the created element is performed during the with_elem closure via the provided moxie_dom::MemoElement wrapper.