<Input type="number"> with time mask

Asked

Viewed 1,339 times

3

How to make a <input type="number"> with mask in the format of hours, which accepts 00:00.

Put type="text" just use a mask, but and with the type="number"?

  • 1

    Another alternative is to use two selects hour and minute. Or a component like the Mobiscroll. I’m not a fan of masks.

1 answer

1


This mask feature is not native to input field. For this you will need Javascript. Jquery for example has many plugins for mask that Voce can see clicking here.

In particular, I recommend you try using jquery input Mask

Project link: https://github.com/RobinHerbots/jquery.inputmask

On this page, the author makes available several forms of mask that you can use including date mask, numeric, monetary and various other formats available.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.