This is my code for modal inside of data tables this modal is for edit but my script only works at first row but if i want to edit the second row the script is not working.

```
<div class="form-group">
        <label for="leave_type">Type of Leave:</label>
        <select class="form-control mylist1" id="mylist1" name="leave_type">
            <option value="Vacation Leave">Vacation Leave</option>
            <option value="Maternity Leave" >Maternity Leave</option>
            <option value="Sick Leave" >Sick Leave</option>
            <option value="Paternity Leave" >Paternity Leave</option>
            <option value="Leave Without Pay" >Leave Without Pay</option>
            <option value="Authorized Absence" >Authorized Absence</option>
            <option value="Unauthorized Absence" >Unauthorized Absence</option>
            <option value="Other">Other</option>
        </select>
    </div>

    <div class="form-group">
        <div id="forshow1" class="forshow1">
        </div>
    </div>

```

And my script

```
  <script>
     $('#mylist1').change(function(){
        if( $(this).val() == 'Other'){
            $('#forshow1').append('<input type="text" name="other" class="form- 
            control" id="myInput1" />');
        }else{
            $('#myInput1').remove();
        }
    });
 </script>

```