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.
精彩评论