Module B00_htmlg.AtSource

Element attributes.

Attributes

Sourcetype name = string

The type for attribute names.

Sourcetype t

The type for attributes.

Sourceval v : name -> string -> t

v n value is an attribute named n with value value.

Sourceval true' : name -> t

true' n is v n "". This sets the boolean attribute n to true. The attribute must be omitted to be false.

Sourceval int : name -> int -> t

int n i is v n (string_of_int i).

Sourceval add_if : bool -> t -> t list -> t list

add_if c att atts is att :: atts if c is true and atts otherwise.

Sourceval add_if_some : name -> string option -> t list -> t list

add_if_some n o atts is (v n value) :: atts if o is Some value and atts otherwise.

Sourceval to_pair : t -> string * string

to_pair at is (n,v) the name and value of the attribute.

Attribute names and constructors

See the MDN HTML attribute reference.

Convention. Whenever an attribute name conflicts with an OCaml keyword we prime it, see for example class'.

Sourcemodule Name : sig ... end

Attribute names.

Sourcetype 'a cons = 'a -> t

The type for attribute constructors with value of type 'a.

Sourceval accesskey : string cons
Sourceval autofocus : t
Sourceval charset : string cons
Sourceval checked : t
Sourceval class' : string cons
Sourceval content : string cons
Sourceval contenteditable : bool cons
Sourceval cols : int cons
Sourceval defer : t
Sourceval disabled : t
Sourceval dir : string cons
Sourceval draggable : bool cons
Sourceval for' : string cons
Sourceval height : int cons
Sourceval href : string cons
Sourceval hidden : t
Sourceval id : string cons
Sourceval lang : string cons
Sourceval media : string cons
Sourceval name : string cons
Sourceval placeholder : string cons
Sourceval rel : string cons
Sourceval required : t
Sourceval rows : int cons
Sourceval spellcheck : string cons
Sourceval src : string cons
Sourceval tabindex : int cons
Sourceval title : string cons
Sourceval type' : string cons
Sourceval value : string cons
Sourceval wrap : string cons
Sourceval width : int cons