<html>
<script src="./js/jquery-3.6.1.js"></script>
<script src="./js/disable_sample.js"></script>
<div style="background-color:#CCC; padding:20px;">
<input type="text" id="txt1" value="クリックdisable">
<input type="button" id="btn2" value="disable解除">
<input type="button" id="btn1" value="test1">
<button type="button" id="btn3" disabled="disabled">test3</button>
<button type="button" id="btn4">test4</button>
<input type="button" id="btn5" name="btnName5" value="test5" disabled="disabled">
</div>
</html>
$(function() {
$("#txt1").click(function() {
$("#btn1").prop("disabled", true);
$("#btn4").prop("disabled", true);
$("input[name='btnName5']").attr("disabled", "disabled");
});
$("#btn2").on("click", function(e) {
$("#btn1").prop("disabled", false);
$("#btn3").prop("disabled", false);
$("#btn4").prop("disabled", false);
$("input[name='btnName5']").removeAttr("disabled");
});
});