Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/87.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用JavaScript从HTML表的特定单元格中获取值_Javascript_Html_Angularjs - Fatal编程技术网

如何使用JavaScript从HTML表的特定单元格中获取值

如何使用JavaScript从HTML表的特定单元格中获取值,javascript,html,angularjs,Javascript,Html,Angularjs,我有一张这样的桌子(AngularJS): {{flight.FlightFrom}} {{flight.FlightTo} {{航班起飞} {{航班抵达} {{flight.Price}货币:“PLN”} {{flight.AvailableSits} 库普·比莱特! 我想进入{{flight.AvailableSits}}值,检查它是否等于0,如果等于0,那么我想禁用Buy按钮。我该怎么做?试试这个: <td><button type="button" id="butt

我有一张这样的桌子(AngularJS):


{{flight.FlightFrom}}
{{flight.FlightTo}
{{航班起飞}
{{航班抵达}
{{flight.Price}货币:“PLN”}
{{flight.AvailableSits}
库普·比莱特!
我想进入
{{flight.AvailableSits}}
值,检查它是否等于0,如果等于0,那么我想禁用Buy按钮。我该怎么做?

试试这个:

<td><button type="button" id="buttonBuy" ng-disabled="flight.AvailableSits === 0">Kup bilet!</button></td>
Kup-bilet!

您可以使用按钮上的
ng show
指令

<button type="button" id="buttonBuy" ng-show="flight.AvailableSits">Kup bilet!</button>
Kup-bilet!

只有在有空位时才会显示按钮

我很高兴这有帮助
<button type="button" id="buttonBuy" ng-show="flight.AvailableSits">Kup bilet!</button>