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?
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
Value was only needed to set there to provide the “customer” an example that can be written there.
Hope this helps
(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 .
there is atrtribute call “placeholder” that make it better
The best example for me is like placeholder. Thanks.
text attribute, we use the
value attribute to send textual information when the form is submitted. In the
number attribute we do not use the
value attribute because the
number attribute already defines what kind of data the
input element will accept. When the
number attribute is rendered, we see an input field has been loaded. In this, numerical information is given by clicking on the up and down arrows present at the right end of this input field, where a click on the up arrow gives us succeeding numbers of a certain number (in default, it is 0) and a click on the down arrow gives us predecessing numbers of it. So there is no need of
value attribute here. To clearly understand this, click on the arrows in the
number attribute field given in the webpage beside the lesson on Number Input in HTML Forms.
Sorry for the late reply, @breekiki . I joined in this platform much later.
Hope this helps !
No, @priyanshumishra58162, you’re wrong. Check out my post on this question.