Set the value of an IDL attribute (a.k.a. "JavaScript property").
The functions in this module wrap VirtualDom.property.
See
here
for some background on when to use the functions in this module versus the
functions in Dom.Attribute.
Set a property that takes a string value; the first argument gives the value and the second argument gives the key
"Hello World!"
|> Dom.Element.textWrapper "p"
|> Dom.Element.withAttributes
[ "title"
|> Dom.Property.string "Hello, again!"
]Set a property that takes an integer value; the first argument gives the value and the second argument gives the key
[ "rows"
|> Dom.Property.int 10
]
|> Dom.Node.leaf "textarea"Set a property that takes a floating point value; the first argument gives the value and the second argument gives the key
[ "type"
|> Dom.Property.string "number"
, "min"
|> Dom.Property.int 0
, "max"
|> Dom.Property.int 1
, "step"
|> Dom.Property.float 0.1
]
|> Dom.Node.leaf "input"
Set a property that takes a boolean value; the first argument gives the value and the second argument gives the key