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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:55:20+00:00 2026-05-31T15:55:20+00:00

I am trying to create a Jquery function to add or remove a drop

  • 0

I am trying to create a Jquery function to add or remove a drop down menu based on the selection of a different drop down menu,

This is my very first time trying to use Java script, and i need a little help to get it going.

here is what i have done up to now, but i cant seem to get it to work can somone tell me where i have gone wrong?

 $(document).ready(function(){
$(function remove() {

$("select#name").val();
        if (name == "United Kindom") {
                $("select.county").show();
                  }  else {
                $("select.county").hide(); });
});






<select name="ab" onchange="remove();">
  • 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-05-31T15:55:21+00:00Added an answer on May 31, 2026 at 3:55 pm

    Firstly, what you’re using is a mash-up of Javascript and jQuery(A Javascript Library). You must understand this. Just so you know the below is jQuery, and I’ll add the pure JS to the end of the post.
    Try This:

    $(document).ready(function(){
       $(".selectWrapper").on("change", "select#ab", function(){
          $("select.county").toggle($(this).val() != "United Kindom");
       });
    });
    
    <div class="selectWrapper">
       <select id="ab">
    

    This is also assuming you have
    <select class="country">
    somewhere in your code.

    //—Pure JS —-

       document.getElementById("ab").onchange = function(){
          var selects = document.getElementsByTagName("select"), countrySelect;
          for(var x in selects){
           countrySelect = (selects[x].className == "country")? select[x] : "";
          }
          countrySelect.style.display = (this.value == "United Kindom")? 'none' : 'block';
       };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a add/remove favorite with jquery and php. The addfavorite function
I am trying to create a menu panel in jQuery, all is complete except
I have been trying to create a menu panel with jQuery that can be
I'm am trying to create a jQuery plugin that will add new namespace functions
I am trying to create an add to 'favourites'button. When the user clicks this
This is my first plugin trying to create using the example provided here .
I'm trying to create a jQuery plugin following some official best practices (function($){ var
I'm trying to add an 'onclick' function to an image with jQuery and for
I'm trying to create a function which will add an overlay to a thumbnail
I'm trying to create a tab menu. And I need this coded in regular

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.