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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T20:42:43+00:00 2026-06-06T20:42:43+00:00

For the select menu plugin chosen.js , is there an established way to add

  • 0

For the select menu plugin chosen.js, is there an established way to add ‘select all items in list’ or ‘remove all items in list’ feature to a multiple select input? In the main branch or perhaps in one of the forks? Or has someone done this before has some tips?

  • 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-06T20:42:45+00:00Added an answer on June 6, 2026 at 8:42 pm

    It should be pretty straight forward, just do it the “normal” way first:

    $('.my-select-all').click(function(){
        $('#my_select option').prop('selected', true); // Selects all options
    });
    

    Then trigger the liszt:updated event to update the chosen widget, so the whole thing would look something like this:


    Update: For those who don’t scroll down and check the other answers, the event is called chosen:updated as of a version released in August 2013. Consult the documentation if in doubt.


    <select multiple>
      <option value="1">1</option>
      <option value="2">2</option>
      <option value="3">3</option>
    </select>
    <button class="select">Select all</button>
    <button class="deselect">Deselect all</button>
    
    $('select').chosen();
    $('.select').click(function(){
        $('option').prop('selected', true);
        $('select').trigger('liszt:updated');
    });
    $('.deselect').click(function(){
        $('option').prop('selected', false);
        $('select').trigger('liszt:updated');
    });​
    

    Working demo (js code is at the bottom): http://jsfiddle.net/C7LnL/1/

    Tighter version: http://jsfiddle.net/C7LnL/2/

    Even tighter version: http://jsfiddle.net/C7LnL/3/

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

Sidebar

Related Questions

I have a SELECT LIST MENU containing products and on this menu i use
I have a html select list menu,when user select an option he/she is redirected
dips is a multiple select drop down menu and dips_list is an array containing
I'm working on this custom select menu that is part of a forms plugin
Selectmenu: https://github.com/fnagel/jquery-ui/wiki/Selectmenu I'm using this plugin to style a select menu on a widget
I am trying to remove text from a dropdown menu using a Jquery plugin
I'm making a select menu plugin to replace the ugly default selects and be
I am using a plugin to create a real slick jquery select (dropdown) menu.
Is there a way to select a parent element based on the class of
I am populating a select menu with getJSON. I am wondering if there's a

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.