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 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)


Editor is Loading...

Advertisement

0 nhận xét:

Đăng nhận xét