以下代码(在未选中复选框include_Ts时隐藏具有class =“ tbuild”的菜单项)在Chrome中有效,但不适用于IE。是否有一种直接的方法可以使它们同时工作?
<style>
.tbuild {
display: none;
}
#include_Ts:checked~select .tbuild {
display: block;
}
</style>
<html>
<strong>Include T-builds:</strong> <input type="checkbox" id="include_Ts" />
<br><br>
<label><strong>Release #1:</strong></label>
<select id="selectedBaseRelease">
<option value="/~releases/file2">ICC2_O-2018.06</option>
<option value="/~releases/file2a" class="tbuild">ICC2_O-2018.06a</option>
<option value="/~releases/file3" selected>ICC2_N-2017.09-SP6</option>
<option value="/~releases/file3a" class="tbuild">ICC2_N-2017.09-SP6a</option>
<option value="/~releases/file4">ICC2_N-2017.09-SP5</option>
<option value="/~releases/file4a" class="tbuild">ICC2_N-2017.09-SP5a</option>
</select>
<br><br>
<label><strong>Release #2:</strong></label>
<select id="selectedNewRelease">
<option value="/~releases/file1" selected>ICC2_O-2018.06-SP1</option>
<option value="/~releases/file1a" class="tbuild">ICC2_O-2018.06-SP1a</option>
<option value="/~releases/file2">ICC2_O-2018.06</option>
<option value="/~releases/file2a" class="tbuild">ICC2_O-2018.06a</option>
<option value="/~releases/file3">ICC2_N-2017.09-SP6</option>
<option value="/~releases/file3a" class="tbuild">ICC2_N-2017.09-SP6a</option></select>
</html>