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 8891073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:38:44+00:00 2026-06-14T22:38:44+00:00

I want to clear the text in textfield, for example if you go to

  • 0

I want to clear the text in textfield, for example if you go to the
gmail account signup
You can see that text will cleared after you start typing,
so simple

document.getElementById("FirstName").value = ""; won’t work, word First still going to be over there.

So how to clear it?
Thank you.

  • 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-14T22:38:46+00:00Added an answer on June 14, 2026 at 10:38 pm

    Take a closer look at the HTML. The string First isn’t a value of the text box but a SPAN that is placed over it via CSS.

    <label id="firstname-label" class="firstname">
      <strong>First name</strong>
      <input id="FirstName" type="text" spellcheck="false" name="FirstName" value="" n="1">
      <span id="firstname-placeholder" class="placeholder-text" style="display: block;">First</span>
    </label>
    

    The technique is sometimes called a watermark.

    As for how to change the value and hide the SPAN

    As soon as the input has a value (it looks like it is bound on the keyUp event) this inline style is added to the span display: none;. If you wanted to programmatically set input#FirstName and clear the span you would need to either programmatically fire the event that is triggering the hiding or also programmatically hide the span (it looks like each input that has a placeholder value uses the ID <input ID>-placeholder so you could guess the correct span based on the ID of the input you are setting)

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

Sidebar

Related Questions

When user click on button , I want to clear text field. How can
I want to compare an string which is in clear text in the database
i want to clear the fields of my form after the user has inserted
I want to clear textbox after ajax posting. <div style=padding: 5px; background-color: Silver;> @using
I want to clear textbox after ajax posting. <div style=padding: 5px; background-color: Silver;> @using
How can I check the value of a textfield ? I just want to
I want to clear the password text field each time the pop-up is shown.
Hy,... So u can see that my test is blurred at the UITextfield in
I want to make my text field clear the text when someone clicks it.
I Created five UITextField using for loop i want to clear the textfield values

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.