复选框

默认效果

<label class="ui-checkbox"><input type="checkbox" name="checkbox-1" checked><i></i>文字</label>
<label class="ui-checkbox"><input type="checkbox" name="checkbox-2"><i></i>文字</label>

禁用状态

<label class="ui-checkbox"><input type="checkbox" name="checkbox-2" disabled><i></i>文字</label>
<label class="ui-checkbox"><input type="checkbox" name="checkbox-2" disabled checked="checked"><i></i>文字</label>

颜色

<label class="ui-checkbox ui-checkbox-red"><input type="checkbox" name="checkbox-2" checked><i></i>文字</label>
<label class="ui-checkbox ui-checkbox-yellow"><input type="checkbox" name="checkbox-2" checked><i></i>文字</label>
<label class="ui-checkbox ui-checkbox-blue"><input type="checkbox" name="checkbox-2" checked><i></i>文字</label>
<label class="ui-checkbox ui-checkbox-green"><input type="checkbox" name="checkbox-2" checked><i></i>文字</label>
<label class="ui-checkbox ui-checkbox-info"><input type="checkbox" name="checkbox-2" checked><i></i>文字</label>

全选/取消

ID First Last Handle
1 Mark Otto @mdo
2 Jacob Thornton @fat
3 Larry the Bird @twitter
4 Mark Otto @mdo
5 Jacob Thornton @fat
取值
<form class="form-test">
<table class="ui-table ui-table-border ui-table-hover ui-table-striped">
<thead class="ui-thead-gray">
<tr>
<th width="60" class="text-center"><label class="ui-checkbox ui-tips" data-align="right-top" data-title="全选/取消"><input type="checkbox" class="checkall" value=""><i></i></label></th>
<th>ID</th>
<th>First</th>
<th>Last</th>
<th>Handle</th>
</tr>
</thead>
<tbody>
<tr>
<td class="text-center"><label class="ui-checkbox"><input type="checkbox" name="id" value="1"><i></i></label></td>
<td>1</td>
<td>Mark</td>
<td>Otto</td>
<td>@mdo</td>
</tr>
<tr>
<td class="text-center"><label class="ui-checkbox"><input type="checkbox" name="id" value="2"><i></i></label></td>
<td>2</td>
<td>Jacob</td>
<td>Thornton</td>
<td>@fat</td>
</tr>
<tr>
<td class="text-center"><label class="ui-checkbox"><input type="checkbox" name="id" value="3"><i></i></label></td>
<td>3</td>
<td>Larry</td>
<td>the Bird</td>
<td>@twitter</td>
</tr>
<tr>
<td class="text-center"><label class="ui-checkbox"><input type="checkbox" name="id" value="4"><i></i></label></td>
<td>4</td>
<td>Mark</td>
<td>Otto</td>
<td>@mdo</td>
</tr>
<tr>
<td class="text-center"><label class="ui-checkbox"><input type="checkbox" name="id" value="5"><i></i></label></td>
<td>5</td>
<td>Jacob</td>
<td>Thornton</td>
<td>@fat</td>
</tr>
</tbody>
</table>
</form>
<script>
$(function()
{
//取值方法
$("#getVal").click(function()
{
var data=[];
$(".form-test").find("input[type=checkbox]:checked").each(function()
{
if($(this).attr("class")!='checkall')
{
data.push($(this).val())
}
})
alert(data.join(","));
})
})
</script>