HTML custom input with type hidden and number1 min read

I don’t think it is possible to a create an element like

Solution is to create a custom element like this

MDN – Using Custom ELements (

To add a property of value to our <hidden-num> element, we must add the get value()  and set value(val)  methods.

An attribute of value is also added to element if the value property is changed. A number  value is returned if the elem.value  is accessed.

Custom element is registered with

customElements.define("hidden-num", InputHiddenNum);

Built in element can also be extended like

<input is="hidden-num" />

Refer – MDN – Customized built-in Elements (