How to enable input box by click on edit button in php

Enable input text box based onclick event of button

Today , we are going to discuss about the tutorial of how to enable input type text box by clicking on edit button. To enable input box on onclick event of button, we use Javascript code for event based work. Onclick event on edit button is used in Javascript to enable input text box for edit and update its value. Let us see example as shown below to understand in detail.

HTML

<input type="text" disabled="disabled" class="inputDisabled" value="">
  <button id="edit">Edit</button>

JAVASCRIPT

<script>
$("#edit").click(function(event){
    event.preventDefault();
    $('.inputDisabled').removeAttr("disabled")
});
</script>