簡體   English   中英

如何從列表框asp.net中選擇多個項目,而無需使用javascript按下CTRL鍵?

[英]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;
 });

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM