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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:49:26+00:00 2026-06-18T14:49:26+00:00

Assume we have three options in html select i.e select, Male, Female. On click

  • 0

Assume we have three options in html select
i.e select, Male, Female.
On click I want to replace select with “”.

The below code I tried.

<select id="ageID">
    <option value="none" >loading...</option>
    <option value="one" >one</option>
    <option value="two">two</option>
    <option value="three">three</option>
</select>  

$("#ageID").on("click",function(){

    $(this).children().first().remove();
    $(this).children().first().before(" <option value='none' > </option>");

});  

It works perfectly on google chrome but not on mozilla or IE.
you can try running it using http://jsfiddle.net/
Please provide a solution

  • 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-18T14:49:28+00:00Added an answer on June 18, 2026 at 2:49 pm

    You can do this :

    $("#ageID").on("click focus",function(){
        this.options[0].text='';
    });  
    

    Demonstration

    I added the focus event because I thought you wanted the change to be made as soon as possible (which wouldn’t be the case with only click).

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

Sidebar

Related Questions

Assume I have three build configurations Build and Run Tests QA Build Production Build
Assume that I have three class; UserAccount, UserGroup and Role. UserGroup and Role are
Assume I have an enumerable object enum and now I want to get the
I have some html code having hierarchy as <div id=a> <span> <span id=s1>...</span> <span
Assume I have some utility that can take a number of options, each followed
I have an HTML (multi)select list containing a list of network devices. <select id=Printers
What have I marked as --assume-unchanged ? Is there any way to find out
I have container of geometrical entities. Let's assume there is circle, ellipse, line, arc.
I have a vector represented by the slope m. Then there is rectangle (assume
Assume I have two tables, Student Test Id Name TestId Type StudentId -- ----

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.