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

  • SEARCH
  • Home
  • 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 9186139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:27:04+00:00 2026-06-17T19:27:04+00:00

Note: I am new to Javascript. Here is code: it is from the html

  • 0

Note: I am new to Javascript.

Here is code:

it is from the html page itself

<form action="#" id="ToolKeywordSearch">
  <input type="text" class="ProductFinderText"
          id="ToolSearchField"onblur="if(this.value=='')    
             {this.value='Enter Search Term ';}" 
                onclick="if (this.value == 'Enter Search Term ')
                  { this.value = ''; }" value="Enter Search Term " />
</form>

 ___________________________________
|  _____________________     ______ |      (restriction does not let me insert image)
| |                  |O |   |      ||
| |enter search term | \|   |Search||                      
|  ---------------------     ------ |
|___________________________________|

Here what it does: when search button is pressed it opens the search field

the search image is a background:

#ToolSearchField {

 background:url(../../Content/images/search_but.png) no-repeat scroll 
    right center   transparent;

cursor:pointer;
}

How to remove the text in the search field? with Javascript or CSS, tried both but it wasn’t successful.

<script type="text/javascript">
    var jo = document.getElementById("ToolSearchField").value;
    alert(jo);
</script>

I receive Enter Search Term as an output. 

Then if I insert remove(); instead, it doesn't do anything.

var jo = document.getElementById("ToolSearchField").value;
    jo.remove();

The final result should have search button that launches the search action.

Tell me please, what am I doing wrong.

  • 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-17T19:27:05+00:00Added an answer on June 17, 2026 at 7:27 pm

    The var jo you’re instantiating has the string value “Enter Search Term ” after your first line of javascript. In the next line you’re telling this string to remove(), which isn’t achieving anything in the original element.

    Try document.getElementById("ToolSearchField").value = ""; instead!

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

Sidebar

Related Questions

I'm new to JavaScript. Here's my code: <script> function text_input_type(type) { if(type=='list'){ document.getElementById("note_input").innerHTML="<input type=\"text\"
this code is correct?? String note = text.txt; FileWriter file = new FileWriter(note); Scanner
<script type=text/javascript> jQuery(document).ready(function () { // note: the `Delete` is case sensitive and is
Note: I'm relatively new to Objective-C and am coming from Java and PHP. Could
I'm trying to copy the Google image search from this page . Here is
I'm fairly new to JavaScript and I'm cleaning up some JavaScript code I downloaded.
I have this code in some of my ASCX files: <%=Html.ActionLink(Resources.Localize.Routes_WidgetsEdit, Edit, Widget, new
I have the following form and javascript function on my web page. This is
I am attempting to add data to my database from my HTML code via
NOTE: I added my new solution at the UPDATE answer below. I try to

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.