Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis0
Is there any difference between placeholder and value attribute?
For example; āplaceholder <inputĀ type="text"Ā id="fname"Ā name="fname" Ā placeholder="John"> āwill display John in the text area āĀ value Ā <inputĀ type="text"Ā id="fname"Ā name="fname" Ā value="John"> āWill display John in the text area
3 Respostas
+ 1
Hi Mau'Kauba Nibabe you could have tried it first by yourself before posting the question and then answering it.
This post will be reported under the offence "self-answer". It might as well be removed.
+ 1
āHi Avinesh, I tried it and didn't realize the difference so I post the question.
šThen I waited for people to answer but no one did.
āSo I went back and tried doing it again, and then I realized the difference.
0
āGot it:
āTheĀ valueĀ attribute puts actual content inside of a form, so if you want to change it you have to delete it first.
āWhile theĀ placeholderĀ attribute puts an image of content inside of a form, so when you click on the box and start typing it disapears.
ā Placeholder is used more so to specify what the input box is for, were as theĀ valueĀ will give a default value.