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!
TO give the prefill value in HTML Side as below:
HTML:
JQUERY:
Use the
value
attribute for the pre filled in values.You seem to look for the input attribute
value
, "the initial value of the control"?https://developer.mozilla.org/de/docs/Web/HTML/Element/Input#attr-value
All you have to do is use the value attribute of input tags:
Or, in the case of a textarea:
To set the default value of an input element, use the
value
attribute.