Number input lets users enter a numeric value and incrementally increase or decrease the value with a two-segment control.
Usage
Here are different types of inputs.
Slots
Fancy larger or smaller input? Add size attribute for additional sizes.
Disabled
Make input look inactive by adding the disabled boolean
attribute to any
<input>
element.
Read only
Events
On input change a CustomEvent goat:change
is triggered by the element.
document.querySelector('#number-input-field').addEventListener('goat:input', function (event) {
myConsole.log('goat:input :: ' + event.target.value);
});
document.querySelector('#number-input-field').addEventListener('goat:change', function (event) {
myConsole.warn('goat:change :: ' + event.target.value);
});