|
for (var i = 0; i <colCount; i ++) {
var classname = event.srcElement.parentElement.cells [i] .className + "2";
event.srcElement.parentElement.cells [i] .className = classname;
}
Hello, I would like to ask you the old question. As above, put the results of the query from the database in the table. If the cursor points to one row, its CLASSNAME will change, and event.srcElement refers to one of the columns pointed to, event .srcElement.parentElement is its row, then iterate through all the columns in this row, and change the CLASSNAME of its column together, but sometimes it will prompt event.srcElement.parentElement.cells is empty or not an object, the page is still the starting page How could it not exist? Please enlighten me! !! !!
Now I want to add a judgment condition to judge whether event.srcElement.parentElement.cells [i] exists, how should I write it?
event.srcElement.parentElement.cells [i]! = null right |
|