1.radio
<input type="radio" name="isbox" value="0" />是
<input type="radio" name="isbox" value="1" />否
取选中值:$("input[name=isbox]:checked").val()
点击事件:
$("input[name='isbox'][value=0]").click(function() {
alert($("input[name=isbox]:checked").val());
});
设置选中:$("input[name='isbox']").get(第N个radio).checked=true;
or $("input[type=radio][value='value']").attr("checked",true);
取消所有选中:$(':input[name=isbox]').each(function(){
$(this).attr('checked','checked');
var tmp = $(this)[0];
tmp.checked = false;
tmp = null;
});
2.select
<select id="sortid">
<option value=""> 请选择</option>
</select>
取选中值:$("#sortid").val()
取选中文本:$('#sortid option:selected').text()
设置选中:$("#sortid").attr("value",value);
3.checkbox
$("[name='checkbox'][checked]").length;
$("[name='checkbox'][checked]").length;