enable/disable buttoninside form

by Akram kamal

HTML

<table>
    <tr><td><button id="btn1">button 1 </button></td></tr>
    <tr><td><button id="btn2">button 2 </button></td></tr>
</table>

JavaScript

$(function() {
               
                    $('#btn2').prop("disabled", true);

                    $('#btn1').on('click', function() {
                       
                        $('#btn2').prop("disabled", false);
                       
                    });
                   
   
                });