I am trying to enable input field using mouse click, is there a way to achieve it?
Here's what my interface looked like:
Note: It is required to disable first input fields and by clicked specific input text then it should be enabled.
I would like to enable once specific input field is clicked.
<?php foreach($grades as $grade): ?> <td> <input type="text" class="form-control" value="<?php echo $grade['grade'] ?>" id="gradeid" disabled></td> <?php endforeach; ?> Script:
<script> const inputField = document.getElementById('gradeid'); inputField.onfocus = () => { $('#gradeid').attr('disabled', 'disabled'\''); }; </script> 