Webs_html.At
HTML element attributes.
module Name : sig ... end
Attribute names.
v n value
is an attribute named n
with value value
.
See also (and favor) attribute constructors.
val void : t
void
is an attribute that doesn't get rendered. This is v "" ""
.
val is_void : t -> bool
is_void a
is true
iff a
is void.
true' n
is v n ""
. This sets the boolean attribute n
to true. The attribute must be omitted to be false.
if_some n o
is v n value
if o
is Some value
and void
if o
is None
.
val to_pair : t -> string * string
to_pair at
is (n, v)
the name and value of the attribute.
See the MDN HTML attribute reference.
Convention. Whenever an attribute name conflicts with an OCaml keyword we prime it, see for example class'
.
type 'a cons = 'a -> t
The type for attribute constructors with value of type 'a
.
val autocomplete : string cons
val contenteditable : bool cons
val placeholder : string cons
val spellcheck : string cons