input
$("#add_device_owner_id").val()
$("#add_device_owner_id").val("d")
$('#modal_coffee_cups').attr("readonly","readonly");
Select
$("#add_device_scene_id option:selected").val()
$("#add_device_scene_id option:selected").text()
设置options
var options = [];
$.each(jsonobj, function(index, data) {
options.push("<option value='" + data.areaId + "'> " + data.name + " </option>");
});
$("#" + type).append(options.join(''));
移除除第一个的options
$("#add_device_county_id").find("option").not(":first").remove();
根据value设置选中项
$("#operate_device_type_id").find("option[value = '"+baseInfo.deviceType+"']").attr("selected","selected");
$("#operate_device_type_id").find("option[value = '"+baseInfo.deviceType+"']").removeAttr("selected");
$("#operate_device_type_id").val(0);
Checobox
是否被选中
$("#add_user_agreement_id").is(':checked')
默认选中 checked="checked" $('#modal_sale_add_id').attr("disabled", "disabled");