JavaStudent123 JavaStudent123 - 5 months ago 43
HTML Question

HTML Input - already filled in text

I was wondering, is there a way to put text into an input field?
What i've got now is a placeholder, but that's actually an empty inputfield. So that's not what i'm looking for.
I'm looking for an (kind of) placeholder that's actually filled in into the input field, so not "background text"

This is with placeholder:

And this is what i want:

Is there any way to do this?

Thanks in advance!

Answer Source

The value content attribute gives the default value of the input element.

To set the default value of an input element, use the value attribute.

<input type="text" value="default value">