HTML Input - already filled in text

HtmlInputPlaceholder

Html Problem Overview


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:

http://i.stack.imgur.com/NWY3y.png

And this is what i want:

http://i.stack.imgur.com/AfGSy.png

Is there any way to do this?

Thanks in advance!

Html Solutions


Solution 1 - Html

> The value content attribute gives the default value of the input element. > > - http://www.w3.org/TR/html5/forms.html#attr-input-value</sup>

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

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

Solution 2 - Html

All you have to do is use the value attribute of input tags:

<input type="text" value="Your Value" />

Or, in the case of a textarea:

<textarea>Your Value</textarea>

Solution 3 - Html

You seem to look for the input attribute value, "the initial value of the control"?

<input type="text" value="Morlodenhof 7" />

https://developer.mozilla.org/de/docs/Web/HTML/Element/Input#attr-value

Solution 4 - Html

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

Use the value attribute for the pre filled in values.

Solution 5 - Html

TO give the prefill value in HTML Side as below:

HTML:

<input type="text" id="abc" value="any value">

JQUERY:

$(document).ready(function ()
 {
  $("#abc").val('any value');
 });

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJavaStudent123View Question on Stackoverflow
Solution 1 - Htmluser4639281View Answer on Stackoverflow
Solution 2 - HtmlRyan BobrowskiView Answer on Stackoverflow
Solution 3 - HtmlMatthiasView Answer on Stackoverflow
Solution 4 - Htmlm4n0View Answer on Stackoverflow
Solution 5 - HtmlNavdeep KapilView Answer on Stackoverflow