帮忙看下面一句JS,怎么老报错:“缺少对象”
function setPCust(CustIDClientID)
{
alert(CustIDClientID);
// 'dg_visit_ctl2_txtCustID '
var CustID=document.getElementById( '+ CustIDClientID + ');
// 出错了:“缺少对象”
alert(CustID.value);
if(CustID.value == 'Q00000 '){
CustID.readonly= "false ";
}
else{
CustID.readonly= "true ";
}
}
------解决方案--------------------var CustID=document.getElementById(CustIDClientID);
这样,不要再加引号了