Skip to content Skip to sidebar Skip to footer

Select all values from list box in a single click using javascript

 The following example code will help you to select all or deselect all the items from the list box using javascript code.


    function listboxSelectDeselect(listID, isSelect) {

      var listbox = document.getElementById(listID);

      for (var count = 0; count < listbox.options.length; count++) {

        listbox.options[count].selected = isSelect;

      }

    }



Example Program:- (Editor)


The editor is Loading...

Advertisement

Post a Comment for "Select all values from list box in a single click using javascript"