Skip navigation.

极湖

无不用其“极”

jQuery 判断 checkbox 是否被选中的几种方法

,

方法一:
if ($("#checkbox-id")get(0).checked) {
    // do something
}

方法二:
if($('#checkbox-id').is(':checked')) {
    // do something
}

方法三:
if ($('#checkbox-id').attr('checked')) {
    // do something
}

用土办法记忆可编辑 div 内的光标位置发布一个 jQuery 插件 —— ColorPicker

Write a comment

You must be logged in to write a comment. If you're not a registered member, please sign up.

July 2009
S M T W T F S
June 2009August 2009
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31