Jquery 操作HTML标签

Jquery 操作Radio ,textarea

var val=$('input:radio[name="invoice.hasSend"]:checked').val();
if(val == '2'){
var r=confirm("选择否,发票信息将清空,确定?");
if (r==true)
{
$('input:radio[name="invoice.invoiceType"]').removeAttr("checked");
$('textarea[name="invoice.remark"]').html("");
$('input:radio[name="invoice.invoiceType"]').attr("disabled","true");
$('textarea[name="invoice.remark"]').attr("disabled","true");
}else{
return;
}
}else{
$('input:radio[name="invoice.invoiceType"]').removeAttr("disabled");
$('textarea[name="invoice.remark"]').removeAttr("disabled");
}

Jquery动态添加验证
if(cc == 7){
$("select[name^='register.shipCity']").rules("add", { required: true,maxlength:20});
$("input[name^='register.shipName']").rules("add", { required: true,maxlength:20});
$("textarea[name^='register.remark']").rules("add", { maxlength:200});
$("#invoiceTab").show();

}else{
$("select[name^='register.shipCity']").rules("remove");
$("input[name^='register.shipName']").rules("remove");
$("textarea[name^='register.remark']").rules("remove");
$("#invoiceTab").hide();
}

3.判断Jquery是否验证通过
	var r = $('#user400form').valid();
// alert(r);
if(r){
$('#btnid').attr({'disabled':true});
$("#user400form").submit();
}

你可能感兴趣的:(JS,Jquery)