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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:08:58+00:00 2026-06-08T13:08:58+00:00

I am hiding the default option in the option list when viewing all the

  • 0

I am hiding the default option in the option list when viewing all the options(1,2,3) (when click select 1st time) but then it needs to reappear somehow after making a selection and then viewing the options again..(only by page refresh can user view the select box as containing the category of ‘bathroom’ otherwise meaningless numbers 1,2,3 appear..)

I.e. Currently ‘bathrooms’ does not reappear once option is made and then the select box is clicked again..(if user changes mind) this is the issue. What is the best way to do this.

I can’t change the html – this needs to be done ONLY with Jquery. Help please

<select name="searchForm__bathrooms" id="field-searchForm__bathrooms" class="field-    dropdown">
    <option value=""> Bathrooms </option>
    <option value="1"> 1 </option>
    <option value="3"> 3 </option>
    <option value="2"> 2 </option>
</select>

$('select option:first-child').hide();
  • 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-08T13:09:00+00:00Added an answer on June 8, 2026 at 1:09 pm

    http://jsfiddle.net/earlonrails/EfMvd/2/

    Javascript

    $(function() {
        $("#field-searchForm__bathrooms").change(function() {
            var selectEle = $(this);
            var doAppend = true;  
            $.each(selectEle.children(), function(index, child) {
                if (child.value == "0") {
                    doAppend = false;
                }
            });
            if (doAppend) {
                selectEle.append('<option name="bathroom" value="0">Bathrooms</option>');
            }
        });
    });
    

    HTML

    <body>
        <select name="searchForm__bathrooms" id="field-searchForm__bathrooms" class="field-dropdown">
            <option value="1"> 1 </option>
            <option value="2"> 2 </option>
            <option value="3"> 3 </option>
        </select>
    </body>​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Why is $('*[lang|=de][lang|=sv]').hide(); not selecting and then hiding all my h1s, h2s and ps
ok so im having a hard time hiding some layout sections (divs in my
I'm hiding a div using display:none and this div only shows when we click
This Is Default <p id=pp> THIS DUDE IS HIDING <script type=text/javascript src=/Scripts/jquery-1.4.1.min.js></script> <script type=text/javascript>
In my iPhone app, I'm using MPMoviePlayerController to play a movie. I'm hiding all
When either hiding my tray icon and closing the application, half the time my
I have a notification bar that is 'hiding' behind my header by default: It
For example, in c# access modifiers implement information hiding by default (by giving classes
I have a script that displays one div at a time while hiding the
I'm trying to populate a 'Policy' select dropdown with options based on the 'Company'

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.