Module Brr.At

DOM element attributes.

Attributes

type name = Jstr.t

The type for attribute names.

type t

The type for attributes.

val v : name -> Jstr.t -> t

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

val true' : name -> t

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

val int : name -> int -> t

int n i is v n (Jstr.of_int i).

val add_if : bool -> t -> t list -> t list

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

val add_if_some : name -> Jstr.t option -> t list -> t list

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

val to_pair : t -> Jstr.t * Jstr.t

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'.

module Name : sig ... end

Attribute names.

type 'a cons = 'a -> t

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

val accesskey : Jstr.t cons

accesskey

val autofocus : t

autofocus

val charset : Jstr.t cons

charset

val checked : t

checked

val class' : Jstr.t cons

class

val content : Jstr.t cons

content

val contenteditable : bool cons

contenteditable

val cols : int cons

cols

val defer : t

defer

val disabled : t

disabled

val dir : Jstr.t cons

dir

val draggable : bool cons

draggable

val for' : Jstr.t cons

for'

val height : int cons

height

val href : Jstr.t cons

href

val hidden : t

hidden

val id : Jstr.t cons

id

val lang : Jstr.t cons

lang

val media : Jstr.t cons

media

val name : Jstr.t cons

name

val placeholder : Jstr.t cons

placeholder

val rel : Jstr.t cons

rel

val rows : int cons

rows

val spellcheck : Jstr.t cons

spellcheck

val src : Jstr.t cons

src

val tabindex : int cons

tabindex

val title : Jstr.t cons

title

val type' : Jstr.t cons

type

val value : Jstr.t cons

value

val wrap : Jstr.t cons

wrap

val width : int cons

width