以下の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>