Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <table>
- <tbody>
- <tr>
- <td>
- <input class="txtInput" type="text" name="test1" value="test1val" readonly/>
- </td>
- <td>
- <input type="button" class="btnEdit" name="editName" value="Edit"/>
- </td>
- </tr>
- <tr>
- <td>
- <input class="txtInput" type="text" name="test2" value="test2val" readonly />
- </td>
- <td>
- <input type="button" class="btnEdit" name="editName" value="Edit" />
- </td>
- </tr>
- </tbody>
- </table>
- $(document).ready(function () {
- $('.btnEdit').click(function () {
- if ($('.txtInput').prop('readonly')) {
- $('.txtInput').removeAttr('readonly');
- }
- else {
- $('.txtInput').attr('readonly', 'readonly')
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement