On below code when I click the button it get disabled,
So I want when I click another button. disabled button gets enabled
Like Button 1 has been clicked and disabled,
when another button clicked like button 3, button 1 be enabled
its like 1 is clicked and disabled then when 2 is clicked and disabled then 1 gets enabled Like that
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="p-5">
<button id="button1">Button 1</button>
<button id="button2">Button 2</button>
<button id="button3">Button 3</button>
<button id="button4">Button 4</button>
<p id="status" class="py-3"></p>
</div>
<script type="text/javascript">
$(function () {
$("#button1").click(function () {
$("#button1").prop("disabled", true);
$("p").text("You have clicked on Button 1");
$(this).text("Selected");
});
$("#button2").click(function () {
$("#button2").prop("disabled", true);
$("p").text("You have clicked on Button 2");
$(this).text("Selected");
});
$("#button3").click(function () {
$("#button3").prop("disabled", true);
$("p").text("You have clicked on Button 3");
$(this).text("Selected");
});
$("#button4").click(function () {
$("#button4").prop("disabled", true);
$("p").text("You have clicked on Button 4");
$(this).text("Selected");
});
});
</script>
</body>
</html>