Toggle Disabled Attribute in Jquery

In this article, In this article, we are going to create an HTML input box that is Toggle Disabled and Enable by a single button in Jquery.


<html >
      <script src="" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>

    <input type="text" id="tt1" /><br />

   <button type="button" id="btn1">Disable</button>


 $(document).ready(function () {
            $('#btn1').click(function () {
               $('#tt1').prop('disabled', function(i, v) { return !v; });

I hope this code will helpful for you.