Make an radio form element trigger unit conversion by adding
data-convert-toggle="length-cm", where the attribute value is the type (
length) and the units (
in) separated with a dash.
Optionally, you can convert a subset of the document by adding
data-convert-toggle-target="#myTarget" to specify a CSS selector.
data-convert-length="length-cm,weight-kg" to force multiple types of units to convert at the same time.
Note that the value across toggles is kept in sync. These are grouped together using
data-convert-toggle-group="myGroupName". (Note that only toggles inside of the applicable target are kept in sync, determined by
data-convert-toggle-target as noted above)
Use data attributes to force label text for a certain type/units combination. For example,
data-convert-label-length-cm would leave off the label for that element when it was converted to centimeters.
data-convert-label-length-cm="centimeters" would label using centimeters.