我有一个使用 div 的表格网格。在该表中,我有一个复选框和每一行的文本框。如果选中该复选框,我想禁用文本框。我在这里附上了小提琴。如何在 javascript 中找到下一个要禁用的 div。
HTML
<div class="containerDiv">
<div class="rowDivHeader">
<div class="cellDivHeader">Recommendation</div>
<div class="cellDivHeader">Typical savings</div>
<div class="cellDivHeader">Improved SAP</div>
<div class="cellDivHeader">Improved EI</div>
<div class="cellDivHeader">Indicative cost</div>
<div class="cellDivHeader">Include</div>
<div class="cellDivHeader lastCell">Removal Reason</div>
</div>
<div class="rowDiv">
<div class="cellDiv">Room-in-roof-insulation</div>
<div class="cellDiv">93.0</div>
<div class="cellDiv">F : 29</div>
<div class="cellDiv">B : 89</div>
<div class="cellDiv">£1,500 - £2,700</div>
<div class="cellDiv">
<input type="checkbox" class="checkbox"/>
</div>
<div class="cellDiv lastCell">
<input type="text" class="textbox"/>
</div>
</div>
<div class="rowDiv">
<div class="cellDiv">Room-in-roof-insulation</div>
<div class="cellDiv">93.0</div>
<div class="cellDiv">F : 29</div>
<div class="cellDiv">B : 89</div>
<div class="cellDiv">£1,500 - £2,700</div>
<div class="cellDiv">
<input type="checkbox" class="checkbox"/>
</div>
<div class="cellDiv lastCell">
<input type="text" class="textbox"/>
</div>
</div>
<div class="rowDiv">
<div class="cellDiv">Room-in-roof-insulation</div>
<div class="cellDiv">93.0</div>
<div class="cellDiv">F : 29</div>
<div class="cellDiv">B : 89</div>
<div class="cellDiv">£1,500 - £2,700</div>
<div class="cellDiv">
<input type="checkbox" class="checkbox"/>
</div>
<div class="cellDiv lastCell">
<input type="text" class="textbox"/>
</div>
</div>
</div>