+ 1
What is the uses of value attribute in Input tag?
tell me some examples
2 Answers
+ 2
Cases I can think of right now:
if you want a pre filled text input.
if you want to pass a value through a hidden input.
to display a text in the button of a submit input.
+ 1
value attribute allows to
1. assign a default value for the said control at design
time. For eg,
<input type="text" name="n1" value="100">
2. when form data is submitted for processing, it
returns present data of the respective input