javascript错误
function ActiveTab() {
var a= $find("ctl00_ContentPlaceHolder1_tcEmployee_ClientState").value;
alert("First line");
var add=document.getElementById("ctl00_ContentPlaceHolder1_btnAddRecord");
alert("after add");
var update=document.getElementById("ctl00_ContentPlaceHolder1_btnUpdateRecord");
alert("after update");
var delet= document.getElementById("ctl00_ContentPlaceHolder1_DeleteRecord");
alert("after del");
if(a == 0)
{
alert("if 0");
add.WebForm_PostBackOptions = "Insertion";
update.WebForm_PostBackOptions = "Insertion";
delet.WebForm_PostBackOptions = "Insertion";
}
else if(a == 1)
{
alert("if 1");
add.WebForm_PostBackOptions = "Insertion1";
update.WebForm_PostBackOptions = "Insertion1";
delet.WebForm_PostBackOptions = "Insertion1";
}
else
{
alert("else");
add.WebForm_PostBackOptions = "Insertion2";
update.WebForm_PostBackOptions = "Insertion2";
delet.WebForm_PostBackOptions= "Insertion2";
}
}
什么是我的代码我收到的问题}和;缺失错误,什么是错我的代码javascript错误
回答:
应该是getElementById
:
var add = document.setElementById("ctl00_ContentPlaceHolder1_btnAddRecord");
和失踪=
:
var delet document.getElementById("ctl00_ContentPlaceHolder1_DeleteRecord");
以上是 javascript错误 的全部内容, 来源链接: utcz.com/qa/266351.html