简体   繁体   中英

How to select multiple items from a listbox asp.net without pressing the CTRL key using javascript?

如何使用JavaScript在不按CTRL键的情况下从列表框中选择多个项目?

 <asp:ListBox ID="Satellites"  runat="server" AppendDataBoundItem="true" AutoPostBack="true"  onchange='GetValueSatellite();' Width="400px" SelectionMode="Multiple"></asp:ListBox>
$('option').mousedown(function (e) {
  e.preventDefault();
  $(this).prop('selected', $(this).prop('selected') ? false : true);
  return false;
 });

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM