答案 0 :(得分:1)
const combosSuperGrupo = document.getElementsByName("combosSupG");
combosSuperGrupo.forEach(_ => _.disabled = true);

<select id="comboSuperGrupos1" name="combosSupG">
<option value="0">N...</option>
<!-- X OPTIONS -->
</select>
<select id="comboSuperGrupos2" name="combosSupG">
<option value="0">N...</option>
<!-- X OPTIONS -->
</select>
&#13;
答案 1 :(得分:1)
jQuery:
JAVA_OPTS
JavaScript:
$('select[name="combosSupG"]').attr('disabled',true);
答案 2 :(得分:0)
这是如何禁用具有该名称的每个选择:
$("select[name='combosSupG']").prop('disabled', true);
&#13;
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<select id="comboSuperGrupos1" name="combosSupG">
<option value="0">N...</option>
<!-- X OPTIONS -->
</select>
<select id="comboSuperGrupos2" name="combosSupG">
<option value="0">N...</option>
<!-- X OPTIONS -->
</select>
&#13;
这是禁用页面中每个选择的方法:
$("select").prop('disabled', true);
&#13;
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<select id="comboSuperGrupos1" name="combosSupG">
<option value="0">N...</option>
<!-- X OPTIONS -->
</select>
<select id="comboSuperGrupos2" name="combosSupG">
<option value="0">N...</option>
<!-- X OPTIONS -->
</select>
&#13;