40. spinner

spinner(key, value, ..., key, value)

Inserts in generated content a spinner control. This control can be used to edit the value of the element which is the target of the CSS rule. If "attribute, attribute_name" is specified, this control can be used to edit the value of an attribute of this target element.

KeyValueDefaultDescription
attributeQualified name of attribute to be editedNo defaultWithout this parameter, the control is used to edit the value of the element for which the control has been generated.
columnsPositive integerAutomatically computed when possible; otherwise 10Width of the text field in characters.
countryUpper-case, two-letter codes as defined by ISO-3166. Example: "ES".Country of default locale.Participates in specifying the locale to use.
data-typebyte | short | int | long | float | doubledoubleBase data type of attribute or element value being edited.
languageLower-case, two-letter codes as defined by ISO-639. Example: "es".Language of default locale.Participates in specifying the locale to use.
maxNumberNo maximum.Maximum value for the number edited using the spinner.
minNumberNo minimum.Minimum value for the number edited using the spinner.
patternPattern supported by java.text.DecimalFormatA simple pattern which depends on data-type.Specifies how number is to be parsed and formatted.
stepStrictly positive number1The number is incremented or decremented by this amount when the user clicks the arrow buttons of the spinner.
variantVendor or browser-specific code. Example: "Traditional_WIN".Variant of default locale.Participates in specifying the locale to use.

Key, value, ..., key, value may also specify style parameters.

Example:

count {
    content: spinner(attribute, value,
                     data-type, byte);
}

weight {
    content: spinner(min, 0, 
                     max, 1, 
                     step 0.01,
                     pattern, "0.00####",
                     language, en, 
                     country, "US");
}

See also number-field.