What does the value attribute do?

When using the type=“text’” attribute we used the value attribute. But i don’t see it being used when using the type=“number” atrribute. Why so?

1 Like

type has nothing to do with value, of course I mean that type will change how (for example password) and what can be written there (for example number) but there aren’t any links between these like when using for and name.

Value was only needed to set there to provide the “customer” an example that can be written there.

Hope this helps :grinning:
(And I’m really sorry for the late reply but I got busy)


they must have thaught of it as unnecessary, the motive for them to use value attribute was to make sure that we also know about that""""
hope my answer helps you correct me if i’m wrong!!!

The purpose of value attribute is just to give an example case of what should be entered over there .

1 Like

there is atrtribute call “placeholder” that make it better

The best example for me is like placeholder. Thanks.