package brr

  1. Overview
  2. Docs
Browser programming toolkit for OCaml

Install

dune-project
 Dependency

Authors

Maintainers

Sources

brr-0.0.7.tbz
sha512=4b3d42eb6a32c1d6f1c5ef003f5311b5029156b31f6e51af098b695c769699e0304b66afd2dd574ecf1084e095bbbc4eac552daab083766cd81ed2f1d9897d51

doc/brr/Brr/At/index.html

Module Brr.AtSource

DOM element attributes.

Attributes

Sourcetype name = Jstr.t

The type for attribute names.

Sourcetype t

The type for attributes.

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

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

Sourceval void : t

void is an attribute that doesn't exist. It is ignored by functions like El.v. This is v Jstr.empty Jstr.empty.

Sourceval is_void : t -> bool

is_void a is true iff a is void.

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

Sourceval int : name -> int -> t

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

Sourceval float : name -> float -> t

float n f is v n (Jstr.of_float f).

Sourceval if' : bool -> t -> t

if' b a is a if b is true and void otherwise.

Sourceval if_some : t option -> t

if_some o is a if o is Some a and void if o is None.

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

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

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

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

  • deprecated use Brr.At.if' instead.
Sourceval 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.

  • deprecated use Brr.At.if_some instead.

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 : Jstr.t cons
Sourceval autocomplete : Jstr.t cons
Sourceval autofocus : t
Sourceval checked : t
Sourceval class' : Jstr.t cons
Sourceval cols : int cons
Sourceval contenteditable : bool cons
Sourceval defer : t
Sourceval disabled : t
Sourceval download : Jstr.t cons
Sourceval draggable : Jstr.t cons
Sourceval height : int cons
Sourceval hidden : t
Sourceval method' : Jstr.t cons
Sourceval placeholder : Jstr.t cons
Sourceval required : t
Sourceval rows : int cons
Sourceval selected : t
Sourceval spellcheck : Jstr.t cons
Sourceval tabindex : int cons
Sourceval width : int cons