jquery如何获取checkbox,并判断是否选中

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/hyunbar/article/details/81985382
<div id="divId" class="divTable">
    <divclass="tableBody">
        <ul>
            <li>
                <input type="checkbox" value="501">
            </li>
        </ul>
    </div>
</div>
$("input[type='checkbox']").attr('value')

返回结果:501

$("input[type='checkbox']").is(':checked')

返回结果:选中=true未选中=false

猜你喜欢

转载自blog.csdn.net/hyunbar/article/details/81985382