Custom numbers in input type="number"

Can I add to my input type="number" custom values? I would like to put in only : 1, 2, 4, 8, 16 and 32.

Now I can't find other options than steps or max/min, but I don't know how can I do with this.

Hope you help me, Greets

1 answer

  • answered 2018-02-23 11:05 srulik

    you can't do this with <input type="number"> but this may work for you:

    <input list="numbers">
     <datalist id="numbers">
        <option value="1">
        <option value="2">
        <option value="4">
        <option value="8">
        <option value="16">
        <option value="32">