How do placeholders work?

How placeholder works??

placeholder is an attribute, like value that will display in the input field. Unlike value, though, it is typed over and can be used in place of a label. It has no effect on the value that is POSTed.

<input name="name" placeholder="Name" value="">
<input name="email" placeholder="Email" value="">
15 Likes

We know that after submitting the form name=value is sent as pair. So, when we’ll add placeholder attribute then can we add value to the value attribute?

And if we’ll be able to add value then can we send the name=value pairs?

If you hard code a value, the placeholder will not display.

2 Likes