Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8778411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:31:56+00:00 2026-06-13T19:31:56+00:00

I think its a easy question, but i dont know how to search this

  • 0

I think its a easy question, but i dont know how to search this question in google

I need a background text in a input-text field. Like: Insert Your Name.
And when i press in to the field to insert my name, the text disappears

Okay, thanks for the solution.

<input id="textfield" name="textfield" type="text" placeholder="correct" />

Now i get i second question. How can i change the color of the placeholder?
Here’s my text-area:
http://jsfiddle.net/wy8cP/1/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T19:31:57+00:00Added an answer on June 13, 2026 at 7:31 pm

    Here is how you can get a placeholder using HTML5:

    <input id="textfield" name="textfield" type="text" placeholder="enter something" />
    

    EDIT:

    I no longer recommend hacking together your own polyfills as I showed below. You should use Modernizr to first detect whether a polyfill is needed in the first place, and then activate a polyfill library that fits your needs. There is a good selection of placeholder polyfills listed in the Modernizr wiki.

    ORIGINAL (contd):

    And here is a polyfill for compatibility:

    <input id="textfield" name="textfield" type="text" value="enter something" onfocus="if (this.value == 'enter something') {this.value = '';}" onblur="if (this.value == '') {this.value = 'enter something';}">
    

    http://jsfiddle.net/q3V4E/1/

    A better shim approach is to run this script on page load, and put your placeholders in the data-placeholder attribute, so your markup looks like this:

    <input id="textfield" name="textfield" type="text" data-placeholder="enter something">
    

    and your js looks like this:

    var inputs = document.getElementsByTagName("input");
    for (var i = 0; i < inputs.length; i++) {
        inputs[i].value = inputs[i].getAttribute('data-placeholder');
        inputs[i].addEventListener('focus', function() {
            if (this.value == this.getAttribute('data-placeholder')) {
                this.value = '';
            }
        });
        inputs[i].addEventListener('blur', function() {
            if (this.value == '') {
                this.value = this.getAttribute('data-placeholder');
            }
        });
    }
    

    http://jsfiddle.net/q3V4E/4/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry if this question seems a bit complex but I think its all related
I think its a rather simple question but I couldn't really find an answer
There are many errors here in SO, but this scenario I think its different.
can't seem to get this parser to work for google maps, I think its
I (think I) know what you're thinking... not another EXC_BAD_ACCESS question but I'm really
I think that's not a difficult question but i want to know how to
I think its easy to create form via only html and do not use
Does anyone know off a way or maybe think its possible to connect Node.js
I want to make something that makes much sense, but I think its not
I know this probably is not the easiest thing to do, but I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.