开发者

Javascript undefined attribute

I'm new to Javascript and I got this:

I have a GridView with the following event:

protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
{
  foreach (TableCell c in e.Row.Cells)
  {
    c.Attributes.Add("full","false");
  }
}

And in my javascript I have an onClick event for every cell:

if(source.full="false")
{
  ...
  source.full="true";
}
else
{
  ...
  source.full="false";
}

Why is it that source.full开发者_开发技巧 is always undefined on the first click?


I now used getAttribute and setAttribute instead like Simen said and it works very well.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜