-1
我想检查表格的特定tr(行)是否具有无显示值。如果是的话那么我想它来执行一些不同的代码对我来说:检查(如果语句)表tr元素是否显示为无
if $('.table')[0].rows[5].style.display == "none" {
$('.table')[0].rows[5].style.display = "none";
$('.table')[0].rows[4].style.display = "none";
}else{
$('.table')[0].rows[5].style.display = "table-row";
$('.table')[0].rows[4].style.display = "table-row";
}
我试过,但我在,如果线得到错误ncaught SyntaxError: Unexpected identifier
。
我试着将此行设置为一个变量,然后检查是否变量是==为“无”,但我仍然收到相同的错误。
我在做什么错?
它应该是'if(CONDITION)'而不是'CONDITION' – choz
这是无效的javascript语法。 [如果陈述需要括号](http://www.w3schools.com/js/js_if_else.asp)。 –