我的网页上有100个复选框。出于测试目的,我想勾选所有这些框,但手动单击非常耗时。有没有可能让他们打勾呢?
也许是JavaScript或Chrome的控制台窗口,什么都行?
发布于 2012-06-06 12:51:12
通过使用jquery,就这么简单
$('input:checkbox').each(function () {
// alert(this);
$(this).attr('checked', true);
});或者简单地使用
$('input:checkbox').prop('checked', true);// use the property或
$('input:checkbox').attr('checked', true); // by using the attributehttps://stackoverflow.com/questions/10908212
复制相似问题