假設我有下面的html。怎樣才能最有效地做到這一點?使用jQuery來填充選中複選框的值的範圍
複選框的列表可以增長到數百,所以要保持它的小
<span class="text"></span>
<div class="allboxes">
<input type="checkbox" value="a">
<input type="checkbox" value="b">
<input type="checkbox" value="c">
<input type="checkbox" value="d">
</div>
// on click of a checkbox, span should be populated by the checked boxes
// <span class="text">a b d</span>