Toggle between icons using javascript or jquery

Toggle between icons using javascript or jquery
0.0 0

#1

Hi everyone, i need to toggle between “edit icon” and “okay icon” in my website, so can anyone suggest me.

now the code is

$(’#projectsTable’).Tabledit({

       url: '#',
     deleteButton: false,


     buttons: {
           edit: {
               class: 'btn btn-primary secodary',
               html: '<object onclick="myFunction()" id="edit-button" data= "/concrete5/application/images/animated/btn_edit.svg" type="image/svg+xml" width="30" height="30><img src="/concrete5/application/images/animated/btn_edit.svg" width="40" height="40" alt="Edit"></object>',
               action: 'edit'
           }
       },

       columns: {
           identifier: [1, 'Projects'],
           hideIdentifier: true,
         editable: [[1, 'Projects'], [2, 'Subprojects'],[8, 'Project Status', '{"1": "Open", "2": "Closed"}']]
       },



       onDraw: function() {
           console.log('onDraw()');
       },
       onSuccess: function(data, textStatus, jqXHR) {
           console.log('onSuccess(data, textStatus, jqXHR)');
           console.log(data);
           console.log(textStatus);
           console.log(jqXHR);
       },
       onFail: function(jqXHR, textStatus, errorThrown) {
           console.log('onFail(jqXHR, textStatus, errorThrown)');
           console.log(jqXHR);
           console.log(textStatus);
           console.log(errorThrown);
       },
       onAlways: function() {
           console.log('onAlways()');
       },
        onAjax: function(action, serialize) {
            console.log('onAjax(action, serialize)');
            console.log(action);
            console.log(serialize);
        }



  });