0
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 Réponses
+ 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.