function ActiveTab()
{
var a= $find("ctl00_ContentPlaceHolder1_tcEmployee_ClientState").value;
alert("First line开发者_StackOverflow中文版");
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";
}
}
What is problem with my code I receive }
and ;
missing error. What is wrong with my code?
should be getElementById
:
var add = document.setElementById("ctl00_ContentPlaceHolder1_btnAddRecord");
and missing =
:
var delet document.getElementById("ctl00_ContentPlaceHolder1_DeleteRecord");
精彩评论