Skip to main content

checkbox_named

Function checkbox_named 

Source
pub fn checkbox_named(
    name: impl AsRef<str>,
    value: impl AsRef<str>,
    checked: bool,
) -> Element
Expand description

An <input type="checkbox" name="…" value="…">, with checked when asked.

§Examples

use molt::prelude::*;
assert_eq!(
    checkbox_named("terms", "yes", true).render(),
    r#"<input type="checkbox" name="terms" value="yes" checked>"#
);