disable other options in select except the selected

 $("#lbCountries").click(function () {
     $("#lbCountires option").each(function (index) {
        if ($(this).is(':selected')) {
            $(this).prop('disabled', false);
         }
         else {
            $(this).prop('disabled', true);
         }
      });
  });

Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
enable or disable a chosen select box disable select html still selectable disable option in select in html disable select option with specific disable item in select html select disable option in select select option with disable how to disable html select option disable all options but no disable option select dropdown jquery make a select disable how to disable select options based another on select ? how to disable other select options on select ? how to disable other options on select ? how to disable other options when selected ? how to disable a select element HOW TO DISABLE selecting in option box select html disable select box option select 2 disable option disable other options if selected dropdown disable other options if one is selected dropdown disable select option on click disable one option in select how to disable dropdown option when specific option is selected disable a option in select disable a select option disable the select how to disable some option in selecet disable a option in select when another option is selected in another select disable a select box html disable option in select html select disable option disable option select option select disable for select disable the select option in html disable option from selected list disable an option in select chosen select disable option select disable option disable selected option from one select box when selected in another select box disable a select element how to disable select option select2 disabled deactivate html option How TO enable disable select in HTML disable select options disable option select disable option in select use disable in select list disable option in select when same option in another select is selected how to make an option disable on select tag how to disable option in select how to disable an option in select select disable all option how to disable a option in select disable select option disable options in select box disable the selection options disable select disable options select html how to disable select jquery select remove all options except selected append option disable to select jquery
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source