這裏是我的代碼:大小()函數不與JS選擇/是
<input type="checkbox"> a<br />
<input type="checkbox"> b<br />
<input type="checkbox"> c<br />
<button>Size</button>
<script>
$('button').click(function() {
alert($('input').is(':checked').size());
});
</script>
JS提琴:http://jsfiddle.net/a8f7stx5/
當我點擊「尺寸」按鈕,我得到一個「遺漏的類型錯誤:未定義不是函數「錯誤。有任何想法嗎?
,或者優選'length'。 – lonesomeday 2014-10-26 16:39:20
@lonesomeday:確實...... :) – 2014-10-26 16:44:50